feat: use authoritative organization directory
Some checks failed
CI/CD Pipeline / Quality Gate (push) Failing after 9s
CI/CD Pipeline / Build and Push Images (push) Has been skipped
CI/CD Pipeline / Deploy Dev via Compose (push) Has been skipped
CI/CD Pipeline / Internal Notify (push) Successful in 0s

This commit is contained in:
2026-06-07 16:04:43 +02:00
parent 79f0f8ebf7
commit 6ba8fa8d88
41 changed files with 2781 additions and 1058 deletions

View File

@@ -32,6 +32,7 @@ from apps.parsers.services import (
)
from django.test import TestCase
from organizations.models import (
Organization,
OrganizationSourceFinancialLine,
OrganizationSourceRecord,
)
@@ -40,6 +41,25 @@ from organizations.models import (
class DirectIngestionParserServicesTest(TestCase):
"""Parser save services should not write legacy parser record rows."""
def setUp(self):
for inn, ogrn in (
("7707083801", "1027700132001"),
("7707083802", "1027700132002"),
("7707083803", ""),
("7707083804", "1027700132004"),
("", "1027700132005"),
("", "1027700132006"),
("7707083809", "1027700132009"),
("7707083810", "1027700132010"),
):
Organization.objects.create(
name=f"Справочник {inn or ogrn}",
inn=inn,
ogrn=ogrn,
kpp="770701001" if inn == "7707083810" else "",
okpo="",
)
def test_industrial_certificate_save_records_writes_organization_source_records(self):
saved = IndustrialCertificateService.save_certificates(
[