feat(registries): add SME and budget imports and fix source API workflows
All checks were successful
Mostovik Backend CI/CD / Tests and lint (push) Successful in 9m37s
Mostovik Backend CI/CD / Build linux/amd64 release images (push) Successful in 4m18s
Mostovik Backend CI/CD / Deploy and verify internal main (push) Has been skipped
Mostovik Backend CI/CD / Deploy customer main (push) Has been skipped
Mostovik Backend CI/CD / Deploy dev (push) Successful in 1m48s
All checks were successful
Mostovik Backend CI/CD / Tests and lint (push) Successful in 9m37s
Mostovik Backend CI/CD / Build linux/amd64 release images (push) Successful in 4m18s
Mostovik Backend CI/CD / Deploy and verify internal main (push) Has been skipped
Mostovik Backend CI/CD / Deploy customer main (push) Has been skipped
Mostovik Backend CI/CD / Deploy dev (push) Successful in 1m48s
This commit is contained in:
@@ -138,6 +138,33 @@ class TestCompaniesCommandsTest(TestCase):
|
||||
expected_financial_years,
|
||||
)
|
||||
self.assertEqual(GenericParserRecord.objects.count(), 20 * 9)
|
||||
snapshot_sources = (
|
||||
ParserLoadLog.Source.FNS_SME_SUPPORT_RECIPIENTS,
|
||||
ParserLoadLog.Source.BUDGET_UBPANDNUBP,
|
||||
)
|
||||
snapshot_records = OrganizationSourceRecord.objects.filter(
|
||||
source__in=snapshot_sources,
|
||||
)
|
||||
self.assertEqual(snapshot_records.count(), 40)
|
||||
self.assertEqual(
|
||||
snapshot_records.filter(legacy_model="", legacy_pk="").count(), 40
|
||||
)
|
||||
self.assertFalse(
|
||||
GenericParserRecord.objects.filter(source__in=snapshot_sources).exists()
|
||||
)
|
||||
support = snapshot_records.filter(source=snapshot_sources[0]).first()
|
||||
self.assertEqual(support.record_type, "sme_support_measure")
|
||||
self.assertEqual(len(support.payload["support_sizes"]), 2)
|
||||
self.assertEqual(
|
||||
support.payload["support_sizes"][0]["value"], str(support.amount)
|
||||
)
|
||||
budget = snapshot_records.filter(source=snapshot_sources[1]).first()
|
||||
self.assertEqual(budget.record_type, "budget_registry_organization")
|
||||
self.assertEqual(budget.status, "inactive")
|
||||
self.assertEqual(budget.payload["registry"]["status_code"], "2")
|
||||
self.assertEqual(
|
||||
budget.payload["upstream"]["info"]["inn"], budget.extension.organization.inn
|
||||
)
|
||||
|
||||
def test_create_updates_the_fixed_dataset_without_duplicates(self):
|
||||
call_command("create_test_companies", stdout=StringIO())
|
||||
@@ -218,7 +245,7 @@ class TestCompaniesCommandsTest(TestCase):
|
||||
year=stale_year,
|
||||
).exists()
|
||||
)
|
||||
self.assertEqual(OrganizationSourceRecord.objects.count(), 20 * 17)
|
||||
self.assertEqual(OrganizationSourceRecord.objects.count(), 20 * 19)
|
||||
|
||||
def test_create_replaces_stale_source_record_for_same_legacy_row(self):
|
||||
call_command("create_test_companies", stdout=StringIO())
|
||||
|
||||
Reference in New Issue
Block a user