fix: preserve long prosecutor authority names
All checks were successful
All checks were successful
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user