fix: scope export freshness and retries to each source group
Some checks failed
Mostovik Backend CI/CD / Build linux/amd64 release images (push) Has been cancelled
Mostovik Backend CI/CD / Deploy dev (push) Has been cancelled
Mostovik Backend CI/CD / Deploy and verify internal main (push) Has been cancelled
Mostovik Backend CI/CD / Tests and lint (push) Has been cancelled

This commit is contained in:
Aleksandr Meshchryakov
2026-10-22 22:36:43 +02:00
parent 2ed39c062b
commit f64bd5f664
9 changed files with 151 additions and 14 deletions

View File

@@ -29,6 +29,13 @@ class OrganizationSourceIngestionServiceTest(TestCase):
return Organization.objects.create(**kwargs)
def test_save_generic_records_writes_source_records_without_legacy_rows(self):
from organizations.source_cache import get_source_data_cache_version
global_before = get_source_data_cache_version()
source_before = get_source_data_cache_version(SourceGroup.DEFENSE_SUPPLIERS)
other_before = get_source_data_cache_version(
SourceGroup.GOVERNMENT_PROCUREMENTS
)
self._directory_organization(
name='ООО "ГОЗ"',
inn="7707083803",
@@ -54,6 +61,14 @@ class OrganizationSourceIngestionServiceTest(TestCase):
)
self.assertEqual(result.scanned, 1)
self.assertNotEqual(global_before, get_source_data_cache_version())
self.assertNotEqual(
source_before, get_source_data_cache_version(SourceGroup.DEFENSE_SUPPLIERS)
)
self.assertEqual(
other_before,
get_source_data_cache_version(SourceGroup.GOVERNMENT_PROCUREMENTS),
)
self.assertEqual(result.created_records, 1)
self.assertEqual(result.updated_records, 0)
self.assertEqual(result.created_extensions, 1)