feat: address QA feedback and limit Checko collection
Some checks failed
CI/CD Pipeline / Quality Gate (push) Failing after 25s
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-07-19 13:32:46 +02:00
parent 63f59b3799
commit 76aed1dca3
17 changed files with 730 additions and 41 deletions

View File

@@ -3,7 +3,16 @@
from io import StringIO
from apps.exchange.state_corp_services import StateCorpExchangeService
from apps.parsers.models import ParserLoadLog
from apps.parsers.models import (
FinancialReport,
GenericParserRecord,
IndustrialCertificateRecord,
IndustrialProductRecord,
InspectionRecord,
ManufacturerRecord,
ParserLoadLog,
ProcurementRecord,
)
from django.core.management import call_command
from django.test import TestCase, override_settings
from organizations.models import (
@@ -79,6 +88,13 @@ class TestCompaniesCommandsTest(TestCase):
).count(),
20 * 4,
)
self.assertEqual(IndustrialCertificateRecord.objects.count(), 20)
self.assertEqual(IndustrialProductRecord.objects.count(), 20)
self.assertEqual(ManufacturerRecord.objects.count(), 20)
self.assertEqual(InspectionRecord.objects.count(), 20)
self.assertEqual(ProcurementRecord.objects.count(), 20)
self.assertEqual(FinancialReport.objects.count(), 20)
self.assertEqual(GenericParserRecord.objects.count(), 20 * 9)
def test_create_updates_the_fixed_dataset_without_duplicates(self):
call_command("create_test_companies", stdout=StringIO())
@@ -125,9 +141,7 @@ class TestCompaniesCommandsTest(TestCase):
.order_by("rn")
.values_list("inn", flat=True)
)
package = StateCorpExchangeService.build_package(
organization_inns=company_inns
)
package = StateCorpExchangeService.build_package(organization_inns=company_inns)
self.assertEqual(
package.payload_counts,
@@ -137,7 +151,7 @@ class TestCompaniesCommandsTest(TestCase):
"manufacturers": 20,
"industrial_products": 20,
"prosecutor_checks": 20,
"public_procurements": 80,
"public_procurements": 60,
"financial_reports": 20,
"arbitration_cases": 20,
"bankruptcy_procedures": 20,
@@ -166,3 +180,6 @@ class TestCompaniesCommandsTest(TestCase):
self.assertTrue(Organization.objects.filter(uid=untouched.uid).exists())
self.assertEqual(OrganizationSourceExtension.objects.count(), 0)
self.assertEqual(OrganizationSourceRecord.objects.count(), 0)
self.assertEqual(GenericParserRecord.objects.count(), 0)
self.assertEqual(IndustrialProductRecord.objects.count(), 0)
self.assertEqual(FinancialReport.objects.count(), 0)