feat(external-data): add information security registry entries endpoint

This commit is contained in:
2026-04-14 11:00:24 +02:00
parent f0c4f501a6
commit 148c4862d7
9 changed files with 168 additions and 4 deletions

View File

@@ -13,6 +13,7 @@ from tests.apps.external_data.factories import (
IndustrialProductFactory,
ProsecutorCheckFactory,
PublicProcurementFactory,
InformationSecurityRegistryEntryFactory,
)
from tests.apps.organization.factories import OrganizationFactory
from tests.apps.user.factories import UserFactory
@@ -89,3 +90,29 @@ class ExternalDataApiTest(APITestCase):
self.assertEqual(procurement_response.data["count"], 1)
self.assertEqual(arbitration_response.status_code, status.HTTP_200_OK)
self.assertEqual(arbitration_response.data["count"], 1)
def test_information_security_registry_entries_filter(self):
InformationSecurityRegistryEntryFactory(
organization=self.organization,
presence_status="present",
)
InformationSecurityRegistryEntryFactory(
organization=self.other_organization,
presence_status="absent",
)
response = self.client.get(
f"/api/v1/information-security-registry-entries/?organization={self.organization.id}"
"&presence_status=present"
)
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data["count"], 1)
result = response.data["results"][0]
self.assertEqual(
result["organization"],
str(self.organization.id),
)
self.assertEqual(result["presence_status"], "present")
self.assertIn("registry_name", result)
self.assertIn("entry_number", result)