fix: group JSON source exports by organization (dev) #43

Merged
avm merged 2 commits from hotfix/json-source-export-dev-20260927 into dev 2026-09-27 11:44:02 +03:00
Showing only changes of commit 25b6cd95a4 - Show all commits

View File

@@ -220,7 +220,10 @@ def test_sro_export_keeps_all_years_and_identifier_strings(export_client, file_f
assert archive.namelist() == [f"sro-membership-check.{file_format}"]
content = archive.read(archive.namelist()[0])
if file_format == "json":
rows = json.loads(content)
organizations = json.loads(content)
assert len(organizations) == 1
assert organizations[0]["okpo"] == "00000001"
rows = organizations[0]["sro_membership"]
elif file_format == "csv":
rows = list(csv.DictReader(StringIO(content.decode("utf-8-sig"))))
else:
@@ -231,7 +234,10 @@ def test_sro_export_keeps_all_years_and_identifier_strings(export_client, file_f
assert len(rows) == 1
assert rows[0]["ИНН"] == "0012345678"
assert rows[0]["ОГРН"] == "0012345678901"
assert rows[0]["ОКПО"] == "00000001"
if file_format == "json":
assert "ОКПО" not in rows[0]
else:
assert rows[0]["ОКПО"] == "00000001"
def test_publication_during_render_retries_then_builds_latest_snapshot(export_client):