fix: preserve long prosecutor authority names
All checks were successful
CI/CD Pipeline / Code Quality Checks (push) Successful in 2m4s
CI/CD Pipeline / Run Tests (push) Successful in 3m44s
CI/CD Pipeline / Build and Push Dev Images (push) Successful in 37s
CI/CD Pipeline / Deploy Dev via Compose (push) Successful in 33s

This commit is contained in:
2026-08-09 12:49:41 +02:00
parent 079d7a8549
commit ea9704f215
3 changed files with 36 additions and 1 deletions

View File

@@ -489,6 +489,7 @@ class ExchangePackageApiTest(APITestCase):
response.data["result"]["financial_reports"]["created_lines"],
1,
)
self.assertEqual(
response.data["result"]["defense_unreliable_suppliers"]["created"],
1,
@@ -535,6 +536,25 @@ class ExchangePackageApiTest(APITestCase):
self.assertEqual(package_import.delivery_channel, ExchangeDeliveryChannel.API)
self.assertEqual(package_import.status, "success")
def test_upload_preserves_long_prosecutor_control_authority(self):
payload = build_exchange_payload()
long_authority = "Межрегиональное контрольное управление " + "А" * 300
payload["prosecutor_checks"][0]["control_authority"] = long_authority
archive = build_exchange_archive(data=payload)
response = self.client.post(
self.url,
{"file": archive},
format="multipart",
HTTP_X_EXCHANGE_TOKEN=TEST_TOKEN,
)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
self.assertEqual(
ProsecutorCheck.objects.get().control_authority,
long_authority,
)
def test_upload_rejects_invalid_exchange_token(self):
archive = build_exchange_archive(data=build_exchange_payload())
invalid_token = get_random_string(24)