diff --git a/backend/geonature/tests/fixtures.py b/backend/geonature/tests/fixtures.py index 428a93a143..60174658b0 100644 --- a/backend/geonature/tests/fixtures.py +++ b/backend/geonature/tests/fixtures.py @@ -547,6 +547,7 @@ def synthese_data(app, users, datasets, source, sources_modules): ("p2_af2", 2497, point2, datasets["belong_af_2"], "p2_af2", source), ("p2_af1", 2497, point2, datasets["belong_af_1"], "p2_af1", source), ("p3_af3", 2497, point3, datasets["belong_af_3"], "p3_af3", source), + ("tax_search_1", 713776, point1, datasets["own_dataset"], "tax_search_1", sources_modules[0]), ]: unique_id_sinp = ( "f4428222-d038-40bc-bc5c-6e977bbbc92b" if not data else func.uuid_generate_v4() diff --git a/backend/geonature/tests/test_synthese.py b/backend/geonature/tests/test_synthese.py index 2a0d2dff23..1ca7d96c47 100644 --- a/backend/geonature/tests/test_synthese.py +++ b/backend/geonature/tests/test_synthese.py @@ -1374,7 +1374,7 @@ def test_observation_count_per_column(self, users, synthese_data): assert item["count"] >= test_cd_nom["count"] def test_get_autocomplete_taxons_synthese(self, synthese_data, users): - taxon = db.session.execute(select(Taxref).filter_by(cd_nom=synthese_data["obs1"].cd_nom)).scalar_one() + taxon = db.session.execute(select(Taxref).filter_by(cd_nom=synthese_data["tax_search_1"].cd_nom)).scalar_one() set_logged_user(self.client, users["self_user"]) @@ -1384,7 +1384,7 @@ def test_get_autocomplete_taxons_synthese(self, synthese_data, users): ) assert response.status_code == 200 - assert response.json[0]["cd_nom"] == synthese_data["obs1"].cd_nom + assert response.json[0]["cd_nom"] == synthese_data["tax_search_1"].cd_nom #recherche par le nom valide d'un taxon, alors que seul un synonyme est présent en synthese response = self.client.get( @@ -1393,7 +1393,7 @@ def test_get_autocomplete_taxons_synthese(self, synthese_data, users): ) assert response.status_code == 200 - assert response.json[0]["cd_nom"] == taxon.cd_ref and response.json[0]["cd_nom"] != synthese_data["obs1"].cd_nom + assert response.json[0]["cd_nom"] == taxon.cd_ref and response.json[0]["cd_nom"] != synthese_data["tax_search_1"].cd_nom @pytest.fixture(scope="class")