feat: use authoritative organization directory
This commit is contained in:
@@ -10,13 +10,6 @@ from organizations.models import (
|
||||
from rest_framework import status
|
||||
from rest_framework.test import APITestCase
|
||||
|
||||
from tests.apps.registers.factories import (
|
||||
OrganizationFactory as RegistryOrganizationFactory,
|
||||
)
|
||||
from tests.apps.registers.factories import (
|
||||
RegisterFactory,
|
||||
RegistryMembershipPeriodFactory,
|
||||
)
|
||||
from tests.apps.user.factories import UserFactory
|
||||
|
||||
|
||||
@@ -172,6 +165,8 @@ class OrganizationSourceExtensionsApiV2Test(APITestCase):
|
||||
name='ООО "With Registry Source"',
|
||||
inn="7707083815",
|
||||
ogrn="1027700132015",
|
||||
opk_registry_membership=True,
|
||||
ropk_razdel_num="source-records",
|
||||
)
|
||||
without_registry = Organization.objects.create(
|
||||
name='ООО "Without Registry Source"',
|
||||
@@ -200,16 +195,6 @@ class OrganizationSourceExtensionsApiV2Test(APITestCase):
|
||||
external_id="INSP-WITHOUT-REGISTRY",
|
||||
title="Проверка организации без реестра",
|
||||
)
|
||||
registry = RegisterFactory(name="Реестр source records")
|
||||
registry_organization = RegistryOrganizationFactory(
|
||||
mn_inn=int(with_registry.inn),
|
||||
mn_ogrn=int(with_registry.ogrn),
|
||||
)
|
||||
RegistryMembershipPeriodFactory(
|
||||
registry=registry,
|
||||
organization=registry_organization,
|
||||
)
|
||||
|
||||
only_registry = self.client.get(
|
||||
reverse("api_v2:organizations:organization-source-records-list"),
|
||||
{
|
||||
@@ -245,8 +230,12 @@ class OrganizationSourceExtensionsApiV2Test(APITestCase):
|
||||
|
||||
def test_source_record_organization_uses_active_registry_identity(self):
|
||||
organization = Organization.objects.create(
|
||||
name="1241800009703",
|
||||
name='ООО "Реестровое имя"',
|
||||
inn="1800020960",
|
||||
kpp="180001001",
|
||||
ogrn="1241800009703",
|
||||
opk_registry_membership=True,
|
||||
ropk_razdel_num="identity",
|
||||
)
|
||||
extension = PlannedInspectionExtension.objects.create(
|
||||
organization=organization,
|
||||
@@ -259,14 +248,6 @@ class OrganizationSourceExtensionsApiV2Test(APITestCase):
|
||||
external_id="INSP-REGISTRY-IDENTITY",
|
||||
title="Проверка организации из реестра",
|
||||
)
|
||||
registry_organization = RegistryOrganizationFactory(
|
||||
pn_name='ООО "Реестровое имя"',
|
||||
mn_inn=1800020960,
|
||||
mn_ogrn=int(organization.ogrn),
|
||||
in_kpp=180001001,
|
||||
)
|
||||
RegistryMembershipPeriodFactory(organization=registry_organization)
|
||||
|
||||
response = self.client.get(
|
||||
reverse("api_v2:organizations:organization-source-records-list"),
|
||||
{
|
||||
@@ -289,6 +270,8 @@ class OrganizationSourceExtensionsApiV2Test(APITestCase):
|
||||
name='ООО "Башнефть-Добыча"',
|
||||
inn="0277106840",
|
||||
ogrn="1090280032699",
|
||||
opk_registry_membership=True,
|
||||
ropk_razdel_num="leading-zero",
|
||||
)
|
||||
extension = PlannedInspectionExtension.objects.create(
|
||||
organization=organization,
|
||||
@@ -301,14 +284,6 @@ class OrganizationSourceExtensionsApiV2Test(APITestCase):
|
||||
external_id="INSP-LEADING-ZERO-INN",
|
||||
title="Проверка организации с ведущим нулем",
|
||||
)
|
||||
registry_organization = RegistryOrganizationFactory(
|
||||
pn_name='ООО "Башнефть-Добыча"',
|
||||
mn_inn=277106840,
|
||||
mn_ogrn=int(organization.ogrn),
|
||||
in_kpp=27701001,
|
||||
)
|
||||
RegistryMembershipPeriodFactory(organization=registry_organization)
|
||||
|
||||
response = self.client.get(
|
||||
reverse("api_v2:organizations:organization-source-records-list"),
|
||||
{
|
||||
@@ -389,8 +364,12 @@ class OrganizationSourceExtensionsApiV2Test(APITestCase):
|
||||
|
||||
def test_flat_source_records_searches_registry_identity_displayed_in_tables(self):
|
||||
organization = Organization.objects.create(
|
||||
name="1241800009704",
|
||||
name='АО "Реестровый поиск"',
|
||||
inn="1800020961",
|
||||
kpp="180001002",
|
||||
ogrn="1241800009704",
|
||||
opk_registry_membership=True,
|
||||
ropk_razdel_num="search",
|
||||
)
|
||||
extension = PlannedInspectionExtension.objects.create(
|
||||
organization=organization,
|
||||
@@ -403,14 +382,6 @@ class OrganizationSourceExtensionsApiV2Test(APITestCase):
|
||||
external_id="INSP-REGISTRY-SEARCH",
|
||||
title="Проверка поиска по реестру",
|
||||
)
|
||||
registry_organization = RegistryOrganizationFactory(
|
||||
pn_name='АО "Реестровый поиск"',
|
||||
mn_inn=1800020961,
|
||||
mn_ogrn=int(organization.ogrn),
|
||||
in_kpp=180001002,
|
||||
)
|
||||
RegistryMembershipPeriodFactory(organization=registry_organization)
|
||||
|
||||
response = self.client.get(
|
||||
reverse("api_v2:organizations:organization-source-records-list"),
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user