Skip to content

Commit

Permalink
Correction fixture sites
Browse files Browse the repository at this point in the history
  • Loading branch information
amandine-sahl committed Dec 8, 2023
1 parent 800ce6c commit 4b2c4d5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions backend/gn_module_monitoring/tests/fixtures/site.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest
import json
from geoalchemy2.shape import from_shape
from geonature.utils.env import db
from shapely.geometry import Point
Expand Down Expand Up @@ -29,9 +30,9 @@ def sites(users, types_site, site_group_with_sites):
sites["no-type"] = TMonitoringSites(
id_inventor=user.id_role,
id_digitiser=user.id_role,
base_site_name=f"no-type",
base_site_description=f"Description-no-type",
base_site_code=f"Code-no-type",
base_site_name="no-type",
base_site_description="Description-no-type",
base_site_code="Code-no-type",
geom=geom_4326,
# Random id_nomenclature_type_site
# FIXME: when id_nomenclature_type_site disapears => remove this line
Expand Down Expand Up @@ -77,9 +78,15 @@ def site_to_post_with_types(users, types_site, site_group_without_sites):
post_data["dataComplement"][type_site_dic["label"]] = copy_dic

post_data["dataComplement"]["types_site"] = list_nomenclature_id

post_data["properties"] = MonitoringSitesSchema().dump(site_to_post_with_types)

post_data["geometry"] = json.loads(post_data["properties"].pop("geometry"))

post_data["type"] = "Feature"
post_data["properties"]["types_site"] = list_nomenclature_id


for type_site in mock_db_type_site:
specific_config = type_site["config"]["specific"]
for key_specific in specific_config:
Expand Down

0 comments on commit 4b2c4d5

Please sign in to comment.