From 6ce299f4384fdd0ec6fb60db50112a7f22192d07 Mon Sep 17 00:00:00 2001 From: rikuke <33894149+rikuke@users.noreply.github.com> Date: Thu, 26 Sep 2024 08:38:50 +0300 Subject: [PATCH] fix: add SBOM to powerBI csv (#3355) --- .../benefit/applications/api/v1/power_bi_integration_views.py | 2 +- .../benefit/applications/tests/test_power_bi_integration.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/benefit/applications/api/v1/power_bi_integration_views.py b/backend/benefit/applications/api/v1/power_bi_integration_views.py index 00306f0a34..a5356e3a9a 100644 --- a/backend/benefit/applications/api/v1/power_bi_integration_views.py +++ b/backend/benefit/applications/api/v1/power_bi_integration_views.py @@ -73,7 +73,7 @@ def _csv_response( prune_data_for_talpa, ) response = StreamingHttpResponse( - csv_service.get_csv_string_lines_generator(), + csv_service.get_csv_string_lines_generator(add_bom=True), content_type="text/csv", ) diff --git a/backend/benefit/applications/tests/test_power_bi_integration.py b/backend/benefit/applications/tests/test_power_bi_integration.py index 9da85df7f5..ff76cf73ff 100644 --- a/backend/benefit/applications/tests/test_power_bi_integration.py +++ b/backend/benefit/applications/tests/test_power_bi_integration.py @@ -24,9 +24,9 @@ def test_get_power_bi_data(power_bi_client, decided_application_with_decision_da # Assert CSV has a header and at least one data row assert len(rows) > 1 header = rows[0] - assert "Hakemusnumero" in header + assert '\ufeff"Hakemusnumero"' in header assert "Talpaan viennin päivä" in header - assert rows[1][header.index("Hakemusnumero")] == str( + assert rows[1][header.index('\ufeff"Hakemusnumero"')] == str( decided_application_with_decision_date.application_number )