Skip to content

Commit

Permalink
test: adjust synthese_data fixtures to include altitudes
Browse files Browse the repository at this point in the history
  • Loading branch information
edelclaux committed Oct 4, 2024
1 parent bc5aa12 commit 7e84951
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion backend/geonature/tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,8 @@ def create_synthese(
cor_observers=[],
date_min="",
date_max="",
altitude_min=800,
altitude_max=1200,
**kwargs,
):
now = datetime.datetime.now()
Expand All @@ -536,6 +538,8 @@ def create_synthese(
the_geom_local=func.ST_Transform(geom, 2154), # FIXME
date_min=date_min,
date_max=date_max,
altitude_min=altitude_min,
altitude_max=altitude_max,
cor_observers=cor_observers,
**kwargs,
)
Expand All @@ -550,9 +554,25 @@ def synthese_data(app, users, datasets, source, sources_modules):
date_2 = datetime.datetime(2024, 10, 3, 8, 9, 10)
date_3 = datetime.datetime(2024, 10, 4, 17, 4, 9)
date_4 = datetime.datetime(2024, 10, 5, 22, 22, 22)
altitude_1 = 800
altitude_2 = 900
altitude_3 = 1000
altitude_4 = 1100

data = {}
with db.session.begin_nested():
for name, cd_nom, point, ds, comment_description, source_m, date_min, date_max in [
for (
name,
cd_nom,
point,
ds,
comment_description,
source_m,
date_min,
date_max,
altitude_min,
altitude_max,
) in [
# Donnnées de gypaète : possède des statuts de protection nationale
(
"obs1",
Expand All @@ -563,6 +583,8 @@ def synthese_data(app, users, datasets, source, sources_modules):
sources_modules[0],
date_1,
date_1,
altitude_1,
altitude_1,
),
(
"obs2",
Expand All @@ -573,6 +595,8 @@ def synthese_data(app, users, datasets, source, sources_modules):
sources_modules[0],
date_1,
date_4,
altitude_1,
altitude_4,
),
(
"obs3",
Expand All @@ -583,6 +607,8 @@ def synthese_data(app, users, datasets, source, sources_modules):
sources_modules[1],
date_2,
date_3,
altitude_2,
altitude_3,
),
(
"p1_af1",
Expand All @@ -593,6 +619,8 @@ def synthese_data(app, users, datasets, source, sources_modules):
sources_modules[1],
date_1,
date_3,
altitude_1,
altitude_3,
),
(
"p1_af1_2",
Expand All @@ -603,6 +631,8 @@ def synthese_data(app, users, datasets, source, sources_modules):
sources_modules[1],
date_3,
date_3,
altitude_3,
altitude_3,
),
(
"p1_af2",
Expand All @@ -613,6 +643,8 @@ def synthese_data(app, users, datasets, source, sources_modules):
sources_modules[1],
date_3,
date_4,
altitude_3,
altitude_4,
),
(
"p2_af2",
Expand All @@ -623,6 +655,8 @@ def synthese_data(app, users, datasets, source, sources_modules):
source,
date_1,
date_2,
altitude_1,
altitude_2,
),
(
"p2_af1",
Expand All @@ -633,6 +667,8 @@ def synthese_data(app, users, datasets, source, sources_modules):
source,
date_1,
date_1,
altitude_1,
altitude_1,
),
(
"p3_af3",
Expand All @@ -643,6 +679,8 @@ def synthese_data(app, users, datasets, source, sources_modules):
source,
date_2,
date_2,
altitude_2,
altitude_2,
),
]:
unique_id_sinp = (
Expand All @@ -662,6 +700,8 @@ def synthese_data(app, users, datasets, source, sources_modules):
[users["admin_user"], users["user"]],
date_min,
date_max,
altitude_min,
altitude_max,
**kwargs,
)
db.session.add(s)
Expand Down

0 comments on commit 7e84951

Please sign in to comment.