feat: address QA feedback and limit Checko collection
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user