Skip to content

Commit

Permalink
fix for debian 11 and python 3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesfize committed Feb 16, 2024
1 parent f9e477b commit 2cc8b80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions backend/geonature/tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ def synthese_with_protected_status(users, datasets, source):
pytest.Fixture
fixture with synthese observations
"""
synthese_element = {}
synthese_element = []

# Retrieve protected taxon from the bdc_statut_taxons table
protected_taxon = db.session.scalars(
Expand All @@ -711,7 +711,7 @@ def synthese_with_protected_status(users, datasets, source):
cor_observers=[users["self_user"]],
)
db.session.add(synthese)
synthese_element[taxon.cd_nom] = synthese
synthese_element.append(synthese)

return synthese_element

Expand Down
7 changes: 5 additions & 2 deletions backend/geonature/tests/test_synthese.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,8 +905,11 @@ def assert_export_status_results(user, set_expected_cd_ref):

user = users["user"]
set_expected_cd_ref = set(
db.session.scalars(select(Taxref.cd_ref).where(Taxref.cd_nom == obs.cd_nom)).one()
for obs in synthese_with_protected_status.values()
db.session.scalars(
select(Taxref.cd_ref).where(
Taxref.cd_nom.in_([el.cd_nom for el in synthese_with_protected_status])
)
).all()
)
assert_export_status_results(user, set_expected_cd_ref)

Expand Down

0 comments on commit 2cc8b80

Please sign in to comment.