Skip to content

Commit

Permalink
fix(taxon-sheet): fix backend tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesfize committed Nov 27, 2024
1 parent 7646fed commit 9ed127a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions backend/geonature/tests/test_synthese.py
Original file line number Diff line number Diff line change
Expand Up @@ -1144,28 +1144,28 @@ def test_taxon_stats(self, synthese_data, users):

# Missing area_type parameter
response = self.client.get(
url_for("gn_synthese.taxon_stats", cd_ref=CD_REF_VALID),
url_for("gn_synthese.taxon_stats", cd_nom=CD_REF_VALID),
)
assert response.status_code == 400
assert response.json["description"] == "Missing area_type parameter"

# Invalid area_type parameter
response = self.client.get(
url_for("gn_synthese.taxon_stats", cd_ref=CD_REF_VALID, area_type=AREA_TYPE_INVALID),
url_for("gn_synthese.taxon_stats", cd_nom=CD_REF_VALID, area_type=AREA_TYPE_INVALID),
)
assert response.status_code == 400
assert response.json["description"] == "Invalid area_type"

# Invalid cd_ref parameter
response = self.client.get(
url_for("gn_synthese.taxon_stats", cd_ref=CD_REF_INVALID, area_type=AREA_TYPE_VALID),
url_for("gn_synthese.taxon_stats", cd_nom=CD_REF_INVALID, area_type=AREA_TYPE_VALID),
)
assert response.status_code == 200
assert response.get_json() == CD_REF_INVALID_STATS

# Invalid cd_ref parameter
response = self.client.get(
url_for("gn_synthese.taxon_stats", cd_ref=CD_REF_VALID, area_type=AREA_TYPE_VALID),
url_for("gn_synthese.taxon_stats", cd_nom=CD_REF_VALID, area_type=AREA_TYPE_VALID),
)
response_json = response.get_json()
assert response.status_code == 200
Expand Down

0 comments on commit 9ed127a

Please sign in to comment.