feat: import additional exchange sections
All checks were successful
CI/CD Pipeline / Code Quality Checks (push) Successful in 2m41s
CI/CD Pipeline / Run Tests (push) Successful in 2m47s
CI/CD Pipeline / Build Docker Images (push) Successful in 2m24s
CI/CD Pipeline / Push to Gitea Registry (push) Successful in 0s
CI/CD Pipeline / Deploy to Server (push) Successful in 0s
All checks were successful
CI/CD Pipeline / Code Quality Checks (push) Successful in 2m41s
CI/CD Pipeline / Run Tests (push) Successful in 2m47s
CI/CD Pipeline / Build Docker Images (push) Successful in 2m24s
CI/CD Pipeline / Push to Gitea Registry (push) Successful in 0s
CI/CD Pipeline / Deploy to Server (push) Successful in 0s
This commit is contained in:
@@ -10,10 +10,13 @@ from rest_framework.test import APITestCase
|
||||
|
||||
from tests.apps.external_data.factories import (
|
||||
ArbitrationCaseFactory,
|
||||
BankruptcyProcedureFactory,
|
||||
DefenseUnreliableSupplierFactory,
|
||||
IndustrialProductFactory,
|
||||
InformationSecurityRegistryEntryFactory,
|
||||
LaborVacancyFactory,
|
||||
ProsecutorCheckFactory,
|
||||
PublicProcurementFactory,
|
||||
InformationSecurityRegistryEntryFactory,
|
||||
)
|
||||
from tests.apps.organization.factories import OrganizationFactory
|
||||
from tests.apps.user.factories import UserFactory
|
||||
@@ -116,3 +119,47 @@ class ExternalDataApiTest(APITestCase):
|
||||
self.assertEqual(result["presence_status"], "present")
|
||||
self.assertIn("registry_name", result)
|
||||
self.assertIn("entry_number", result)
|
||||
|
||||
def test_additional_exchange_sections_are_exposed(self):
|
||||
BankruptcyProcedureFactory.create(
|
||||
organization=self.organization,
|
||||
message_type="Сообщение о намерении",
|
||||
message_date=date(2026, 3, 26),
|
||||
)
|
||||
DefenseUnreliableSupplierFactory.create(
|
||||
organization=self.organization,
|
||||
registry_source="fas_goz",
|
||||
included_at=date(2026, 2, 20),
|
||||
)
|
||||
LaborVacancyFactory.create(
|
||||
organization=self.organization,
|
||||
vacancy_source="trudvsem",
|
||||
published_at=date(2026, 4, 1),
|
||||
)
|
||||
BankruptcyProcedureFactory.create(organization=self.other_organization)
|
||||
DefenseUnreliableSupplierFactory.create(organization=self.other_organization)
|
||||
LaborVacancyFactory.create(organization=self.other_organization)
|
||||
|
||||
bankruptcy_response = self.client.get(
|
||||
f"/api/v1/bankruptcy-procedures/?organization={self.organization.id}"
|
||||
"&message_date_from=2026-01-01&message_date_to=2026-12-31"
|
||||
)
|
||||
defense_response = self.client.get(
|
||||
f"/api/v1/defense-unreliable-suppliers/?organization={self.organization.id}"
|
||||
"®istry_source=fas_goz"
|
||||
)
|
||||
vacancies_response = self.client.get(
|
||||
f"/api/v1/labor-vacancies/?organization={self.organization.id}"
|
||||
"&vacancy_source=trudvsem"
|
||||
)
|
||||
|
||||
self.assertEqual(bankruptcy_response.status_code, status.HTTP_200_OK)
|
||||
self.assertEqual(defense_response.status_code, status.HTTP_200_OK)
|
||||
self.assertEqual(vacancies_response.status_code, status.HTTP_200_OK)
|
||||
self.assertEqual(bankruptcy_response.data["count"], 1)
|
||||
self.assertEqual(defense_response.data["count"], 1)
|
||||
self.assertEqual(vacancies_response.data["count"], 1)
|
||||
self.assertEqual(
|
||||
vacancies_response.data["results"][0]["title"],
|
||||
"Инженер-испытатель",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user