fix(parsers): retry quarantined ROPK snapshots
Some checks failed
CI/CD Pipeline / Quality Gate (push) Successful in 1m11s
CI/CD Pipeline / Build and Push Images (push) Successful in 18s
CI/CD Pipeline / Internal Notify (push) Successful in 1s
CI/CD Pipeline / Deploy Dev via Compose (push) Failing after 11s

This commit is contained in:
2026-08-20 18:24:22 +02:00
parent c6f313090e
commit 7a8e5765ad
2 changed files with 41 additions and 0 deletions

View File

@@ -268,6 +268,46 @@ class RopkSanctionsImportTest(TestCase):
1,
)
def test_duplicate_checksum_with_quarantine_is_reprocessed(self):
raw = _workbook(
[
_row(
"retry",
ogrn="1027700132101",
inn="7707083801",
okpo="12345671",
)
]
).getvalue()
first_artifact, first = import_ropk_sanctions(
handle=BytesIO(raw),
original_name="first.xlsx",
load_batch=24,
uploaded_by_id=None,
)
Organization.objects.create(
name="АО Добавлено после карантина",
inn="7707083801",
ogrn="1027700132101",
okpo="12345671",
opk_registry_membership=True,
directory_imported_at=timezone.now(),
)
second_artifact, second = import_ropk_sanctions(
handle=BytesIO(raw),
original_name="second.xlsx",
load_batch=25,
uploaded_by_id=None,
)
self.assertEqual(first.quarantined, 1)
self.assertEqual(first_artifact.quarantined_count, 1)
self.assertFalse(second.skipped)
self.assertEqual(second.published, 1)
self.assertEqual(second.quarantined, 0)
self.assertEqual(second_artifact.status, ParserSourceArtifact.Status.PUBLISHED)
def test_invalid_header_order_rejects_batch_and_preserves_snapshot(self):
import_ropk_sanctions(
handle=_workbook([_row("old")]),