Skip to content

Commit

Permalink
feat: add missing test for unknow type in list_reports
Browse files Browse the repository at this point in the history
  • Loading branch information
edelclaux committed Sep 18, 2024
1 parent c52ee8e commit b2f58c9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions backend/geonature/tests/test_reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit b2f58c9

Please sign in to comment.