Skip to content

Commit

Permalink
fix(test) : apply @bouttier renaming suggestion and fix permission fa…
Browse files Browse the repository at this point in the history
…iling test caused by the addition of a new dataset in the fixture
  • Loading branch information
jacquesfize committed Oct 11, 2024
1 parent f41b27e commit d58e7e3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ On importe une station qui existe déjà en base et un nouvel habitat, seul l
On importe une station et un habitat existant déjà en base;SKIP_EXISTING_UUID;SKIP_EXISTING_UUID;;EXISTING_STATION_UUID;;17/11/2023;17/11/2023;Toto;;POINT(3.634 44.399);St;EXISTING_HABITAT_UUID;prairie;24;;
technique collect vaut « autre » mais pas de précision fournise;OK !;CONDITIONAL_MANDATORY_FIELD_ERROR;;;VALID_DATASET_UUID;17/11/2023;17/11/2023;Toto;;POINT(3.634 44.399);St;;prairie;24;;10
technique collect vaut « autre » et une précision est bien fournies;OK !;OK !;;;VALID_DATASET_UUID;17/11/2023;17/11/2023;Toto;;POINT(3.634 44.399);St;;prairie;24;moyen précis;10
jeu de données pas actif;OK !;OK !;;;DATASET_NOT_ACTIVE;17/11/2023;17/11/2023;Toto;;POINT(3.634 44.399);St;;prairie;24;moyen précis;10
jeu de données pas actif;DATASET_NOT_ACTIVE;ERRONEOUS_PARENT_ENTITY;;;INACTIVE_DATASET_UUID;17/11/2023;17/11/2023;Toto;;POINT(3.634 44.399);St;;prairie;24;moyen précis;10
2 changes: 1 addition & 1 deletion backend/geonature/tests/imports/test_imports_occhab.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def uploaded_import(
datasets["orphan_dataset"].unique_dataset_id.hex.encode("ascii"),
)
content = content.replace(
b"DATASET_NOT_ACTIVE",
b"INACTIVE_DATASET_UUID",
datasets["own_dataset_not_activated"].unique_dataset_id.hex.encode("ascii"),
)
f = BytesIO(content)
Expand Down
6 changes: 3 additions & 3 deletions backend/geonature/tests/test_gn_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ def test_acquisition_frameworks_permissions(self, app, acquisition_frameworks, d

nested = db.session.begin_nested()
af.t_datasets.remove(datasets["own_dataset"])
af.t_datasets.remove(datasets["own_dataset_not_activated"])
# Now, the AF has no DS on which user is digitizer.
assert af.has_instance_permission(1) == False
# But the AF has still DS on which user organism is actor.
Expand Down Expand Up @@ -564,13 +565,12 @@ def test_datasets_permissions(self, app, datasets, users):
qs = select(TDatasets).where(TDatasets.id_dataset.in_(ds_ids))
assert set(sc(dsc.filter_by_scope(0, query=qs)).unique().all()) == set([])
assert set(sc(dsc.filter_by_scope(1, query=qs)).unique().all()) == set(
[
datasets["own_dataset"],
]
[datasets["own_dataset"], datasets["own_dataset_not_activated"]]
)
assert set(sc(dsc.filter_by_scope(2, query=qs)).unique().all()) == set(
[
datasets["own_dataset"],
datasets["own_dataset_not_activated"],
datasets["associate_dataset"],
datasets["associate_2_dataset_sensitive"],
]
Expand Down

0 comments on commit d58e7e3

Please sign in to comment.