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