Skip to content

Commit

Permalink
feat: wip add test for taxon_medias endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Jules Jean-Louis authored and edelclaux committed Oct 24, 2024
1 parent 97aec26 commit 32a9afe
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions backend/geonature/tests/test_synthese.py
Original file line number Diff line number Diff line change
Expand Up @@ -1836,3 +1836,16 @@ def test_export_observations_sensitive_excluded(
# No feature accessible because sensitive data excluded if
# the user has no right to see it
assert len(response.json["features"]) == 0

@pytest.mark.usefixtures("client_class", "temporary_transaction")
class TestMediaTaxon:
def test_taxon_medias(self, synthese_read_permissions, users):
set_logged_user(self.client, users["self_user"])
synthese_read_permissions(users["self_user"], None, sensitivity_filter=True)

cd_ref = db.session.scalar(select(Taxref.cd_ref))

response = self.client.get(url_for("gn_synthese.taxon_medias", cd_ref=cd_ref))

assert response.status_code == 200
assert isinstance(response.json["items"], list)

0 comments on commit 32a9afe

Please sign in to comment.