feat: expand registry ingestion and demo exchange
All checks were successful
CI/CD Pipeline / Quality Gate (push) Successful in 36s
CI/CD Pipeline / Build and Push Images (push) Successful in 15s
CI/CD Pipeline / Internal Notify (push) Successful in 0s
CI/CD Pipeline / Deploy Dev via Compose (push) Successful in 24s

This commit is contained in:
2026-07-16 12:59:23 +02:00
parent cc5aa84556
commit 007cecc8d5
43 changed files with 3723 additions and 352 deletions

View File

@@ -0,0 +1,42 @@
from apps.parsers import tasks
from apps.parsers.clients.common.structured import MAX_FILE_SIZE_BYTES
from apps.parsers.source_registry import PARSER_SOURCES
from apps.parsers.views import TASKS_BY_NAME
from django.conf import settings
from django.test import SimpleTestCase
class ParserSourceRegistryEisTest(SimpleTestCase):
def test_procurement_urls_select_the_expected_law(self):
common_search_url = (
"https://zakupki.gov.ru/epz/order/extendedsearch/results.html"
)
self.assertEqual(
PARSER_SOURCES["procurements_44fz"].upstream_url,
f"{common_search_url}?fz44=on",
)
self.assertEqual(
PARSER_SOURCES["procurements_223fz"].upstream_url,
f"{common_search_url}?fz223=on",
)
class ParserSourceRegistryFNSTest(SimpleTestCase):
def test_request_body_limit_allows_maximum_registry_archive(self):
self.assertGreater(settings.DATA_UPLOAD_MAX_MEMORY_SIZE, MAX_FILE_SIZE_BYTES)
def test_fns_refresh_uses_bounded_api_task_and_preserves_file_upload(self):
source = PARSER_SOURCES["fns_financial"]
self.assertEqual(
source.task_name,
"apps.parsers.tasks.sync_fns_financial_reports",
)
self.assertEqual(source.parser_strategy, "fns_bfo_bounded_registry_sync")
self.assertTrue(source.supports_file_upload)
self.assertNotIn("query=", source.upstream_url)
self.assertIs(
TASKS_BY_NAME[source.task_name],
tasks.sync_fns_financial_reports,
)