Skip to content

Commit

Permalink
test: add test_synthese
Browse files Browse the repository at this point in the history
  • Loading branch information
edelclaux committed Oct 4, 2024
1 parent 7e84951 commit 277625c
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions backend/geonature/tests/test_synthese.py
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,32 @@ def test_get_one_synthese_record(self, app, users, synthese_data):
)
assert response.status_code == Forbidden.code

def test_taxon_observer(self, synthese_data, users):
set_logged_user(self.client, users["stranger_user"])

CD_REF = 2497
CD_REF_OBSERVERS = {
"items": [
{
"date_max": "Thu, 03 Oct 2024 08:09:10 GMT",
"date_min": "Wed, 02 Oct 2024 11:22:33 GMT",
"media_count": 0,
"observation_count": 3,
"observer": "Bobby Bob",
}
],
"total": 2,
"per_page": 1,
"page": 1,
}
# Missing area_type parameter
response = self.client.get(
url_for("gn_synthese.taxon_observers", cd_ref=CD_REF),
)
response_json = response.get_json()
assert response.status_code == 200
assert response.get_json() == CD_REF_OBSERVERS

def test_color_taxon(self, synthese_data, users):
# Note: require grids 5×5!
set_logged_user(self.client, users["self_user"])
Expand Down

0 comments on commit 277625c

Please sign in to comment.