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

@@ -2,6 +2,7 @@
from decimal import Decimal
from tempfile import NamedTemporaryFile
from unittest.mock import patch
from django.test import TestCase
from openpyxl import Workbook
@@ -61,6 +62,19 @@ class OrganizationDirectoryImportServiceTest(TestCase):
self.assertTrue(organization.goz_participation)
self.assertFalse(organization.opk_registry_membership)
def test_import_xlsx_invalidates_organization_api_cache_after_commit(self):
path = self._workbook_path([self._row(rn="10")])
with (
patch(
"organizations.directory_import.invalidate_organization_api_cache"
) as invalidate_cache,
self.captureOnCommitCallbacks(execute=True),
):
OrganizationDirectoryImportService.import_xlsx(path)
invalidate_cache.assert_called_once_with()
def test_import_xlsx_rejects_missing_required_column(self):
path = self._workbook_path([], headers=SOURCE_HEADERS[:-1])
@@ -111,9 +125,7 @@ class OrganizationDirectoryImportServiceTest(TestCase):
]
embedded_value = "\t".join(str(value or "") for value in first_tail)
embedded_value = (
embedded_value
+ "_x000D_\n"
+ "\t".join(["21", "0", "0", 'ООО "Вторая"'])
embedded_value + "_x000D_\n" + "\t".join(["21", "0", "0", 'ООО "Вторая"'])
)
second_row = self._row(