From b2f58c964b111b5f3f2bbb854bd61436da4442c5 Mon Sep 17 00:00:00 2001 From: Etienne Delclaux Date: Wed, 18 Sep 2024 10:30:00 +0200 Subject: [PATCH] feat: add missing test for unknow type in list_reports --- backend/geonature/tests/test_reports.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/geonature/tests/test_reports.py b/backend/geonature/tests/test_reports.py index e85cab2dad..4fe40d855d 100644 --- a/backend/geonature/tests/test_reports.py +++ b/backend/geonature/tests/test_reports.py @@ -154,6 +154,16 @@ def test_list_reports(self, reports_data, synthese_data, users): ) assert response.status_code == 200 assert len(response.json) == 1 + + # TEST INVALID - TYPE DOES NOT EXISTS + response = self.client.get( + url_for( + url, id_synthese=ids[0], idRole=users["admin_user"].id_role, type="UNKNOW-PIN-TYPE" + ) + ) + assert response.status_code == 400 + assert response.json["description"] == "This report type does not exist" + # TEST VALID - ADD PIN response = self.client.get( url_for(url, id_synthese=ids[0], idRole=users["admin_user"].id_role, type="pin")