fix: resolve parser organizations from directory only
This commit is contained in:
@@ -6,6 +6,7 @@ from apps.parsers.models import ParserLoadLog
|
||||
from django.apps import apps as django_apps
|
||||
from django.core.cache import cache
|
||||
from django.test import TestCase
|
||||
from django.utils import timezone
|
||||
from django_celery_beat.models import PeriodicTask
|
||||
from organizations.cache import get_organization_api_cache_version
|
||||
from organizations.models import (
|
||||
@@ -24,8 +25,13 @@ from tests.apps.parsers.factories import IndustrialCertificateRecordFactory
|
||||
class OrganizationSourceBackfillTasksTest(TestCase):
|
||||
"""Checks Celery tasks that maintain API v2 organization source extensions."""
|
||||
|
||||
@staticmethod
|
||||
def _directory_organization(**kwargs) -> Organization:
|
||||
kwargs.setdefault("directory_imported_at", timezone.now())
|
||||
return Organization.objects.create(**kwargs)
|
||||
|
||||
def test_backfill_all_task_rebuilds_sources_and_invalidates_api_cache(self):
|
||||
organization = Organization.objects.create(
|
||||
organization = self._directory_organization(
|
||||
name='ООО "Источник"',
|
||||
inn="7800000401",
|
||||
ogrn="1027700144401",
|
||||
@@ -57,7 +63,7 @@ class OrganizationSourceBackfillTasksTest(TestCase):
|
||||
)
|
||||
|
||||
def test_backfill_parser_batch_task_limits_source_and_batch(self):
|
||||
organization = Organization.objects.create(
|
||||
organization = self._directory_organization(
|
||||
name='ООО "Пакет источника"',
|
||||
inn="7800000402",
|
||||
ogrn="1027700144402",
|
||||
|
||||
Reference in New Issue
Block a user