-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #427 from MTES-MCT/feature/merge-ein-things
EIN si k/k + Joindre l'EIN à la DAU
- Loading branch information
Showing
16 changed files
with
344 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
envergo/moulinette/migrations/moulinette_n2000_eval_env.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[ | ||
{ | ||
"model": "moulinette.criterion", | ||
"fields": { | ||
"backend_title": "Natura 2000 > EE", | ||
"title": "Natura 2000 si cas par cas", | ||
"subtitle": "ou étude d'impact", | ||
"header": "« Liste nationale » Natura 2000 (2° du I de l'<a href=\"https://www.legifrance.gouv.fr/codes/id/LEGISCTA000022090322/\" target=\"_blank\" rel=\"noopener\">article R414-19 du Code de l'environnement</a>)", | ||
"regulation": 2, | ||
"activation_map": 36, | ||
"activation_distance": 0, | ||
"evaluator": "envergo.moulinette.regulations.natura2000.EvalEnv", | ||
"weight": 5, | ||
"required_action": "", | ||
"required_action_stake": "", | ||
"project_impact": "", | ||
"discussion_contact": "" | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import pytest | ||
|
||
from envergo.geodata.conftest import france_map # noqa | ||
from envergo.moulinette.models import MoulinetteAmenagement | ||
from envergo.moulinette.tests.factories import ( | ||
CriterionFactory, | ||
MoulinetteConfigFactory, | ||
RegulationFactory, | ||
) | ||
|
||
pytestmark = pytest.mark.django_db | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def autouse_site(site): | ||
pass | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def evalenv_criteria(france_map): # noqa | ||
MoulinetteConfigFactory( | ||
is_activated=True, | ||
ddtm_water_police_email="[email protected]", | ||
) | ||
evalenv = RegulationFactory(regulation="eval_env") | ||
n2000 = RegulationFactory(regulation="natura2000") | ||
criteria = [ | ||
CriterionFactory( | ||
title="Evaluation environnementale", | ||
regulation=evalenv, | ||
evaluator="envergo.moulinette.regulations.evalenv.Emprise", | ||
activation_map=france_map, | ||
), | ||
CriterionFactory( | ||
title="EE", | ||
regulation=n2000, | ||
evaluator="envergo.moulinette.regulations.natura2000.EvalEnv", | ||
activation_map=france_map, | ||
), | ||
] | ||
return criteria | ||
|
||
|
||
@pytest.fixture | ||
def moulinette_data(footprint): | ||
return { | ||
# Bizou coordinates | ||
"lat": 48.4961953, | ||
"lng": 0.7504093, | ||
"existing_surface": 0, | ||
"created_surface": footprint, | ||
"final_surface": footprint, | ||
"emprise": footprint, | ||
"zone_u": "non", | ||
"surface_plancher_sup_thld": "oui", | ||
"is_lotissement": "non", | ||
"terrain_assiette": 150000, | ||
} | ||
|
||
|
||
@pytest.mark.parametrize("footprint", [40000]) | ||
def test_ein_if_evalenv_systematique(moulinette_data): | ||
moulinette = MoulinetteAmenagement(moulinette_data, moulinette_data) | ||
moulinette.evaluate() | ||
|
||
assert moulinette.eval_env.emprise.result == "systematique" | ||
assert moulinette.natura2000.eval_env.result_code == "soumis_systematique" | ||
assert moulinette.natura2000.eval_env.result == "soumis" | ||
assert moulinette.natura2000.result == "soumis" | ||
|
||
|
||
@pytest.mark.parametrize("footprint", [40000]) | ||
def test_ein_if_evalenv_cas_par_cas(moulinette_data): | ||
moulinette_data["zone_u"] = "oui" | ||
moulinette = MoulinetteAmenagement(moulinette_data, moulinette_data) | ||
moulinette.evaluate() | ||
|
||
assert moulinette.eval_env.emprise.result == "cas_par_cas" | ||
assert moulinette.natura2000.eval_env.result_code == "soumis_cas_par_cas" | ||
assert moulinette.natura2000.eval_env.result == "soumis" | ||
assert moulinette.natura2000.result == "soumis" | ||
|
||
|
||
@pytest.mark.parametrize("footprint", [5]) | ||
def test_no_ein_if_evalenv_non_soumis(moulinette_data): | ||
moulinette = MoulinetteAmenagement(moulinette_data, moulinette_data) | ||
moulinette.evaluate() | ||
|
||
assert moulinette.eval_env.emprise.result == "non_soumis" | ||
assert moulinette.natura2000.eval_env.result_code == "non_soumis" | ||
assert moulinette.natura2000.eval_env.result == "non_soumis" | ||
assert moulinette.natura2000.result == "non_soumis" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
envergo/templates/moulinette/natura2000/eval_env_non_soumis.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<p> | ||
<strong>Pourquoi le projet n'est-il pas concerné ?</strong> | ||
</p> | ||
|
||
<p> | ||
Au vu des informations saisies, le projet n’est pas soumis à évaluation environnementale, ni à examen au cas par cas (<a href="#regulation_eval_env">voir section « Évaluation environnementale »</a>). | ||
</p> | ||
|
||
<p> | ||
Tout projet soumis à évaluation environnementale, <em>qu’il soit dans un site Natura 2000 ou non</em>, est automatiquement soumis à évaluation des incidences Natura 2000 (EIN). Cette disposition ne s’applique donc pas ici. | ||
</p> | ||
|
||
<p> | ||
<strong>Quel impact environnemental ?</strong> | ||
</p> | ||
|
||
<p> | ||
Un projet est soumis à évaluation environnementale quand il est susceptible d’avoir des impacts significatifs sur l’environnement. En matière de biodiversité, le porteur d’un tel projet doit ainsi s’assurer qu’il n’impacte aucun des sites Natura 2000 à proximité ni les espèces fragiles abritées par ceux-ci. | ||
</p> |
19 changes: 19 additions & 0 deletions
19
envergo/templates/moulinette/natura2000/eval_env_soumis_cas_par_cas.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<p> | ||
<strong>Pourquoi le projet est-il concerné ?</strong> | ||
</p> | ||
|
||
<p> | ||
Au vu des informations saisies, le projet est soumis à examen au cas par cas (<a href="#regulation_eval_env">voir section « Évaluation environnementale »</a>). | ||
</p> | ||
|
||
<p> | ||
Or, tout projet soumis à examen au cas par cas, <em>qu’il soit dans un site Natura 2000 ou non</em>, est automatiquement soumis à évaluation des incidences Natura 2000 (EIN). | ||
</p> | ||
|
||
<p> | ||
<strong>Quel impact environnemental ?</strong> | ||
</p> | ||
|
||
<p> | ||
Un projet est soumis à examen au cas par cas quand il est susceptible d’avoir des impacts significatifs sur l’environnement. En matière de biodiversité, le porteur d’un tel projet doit ainsi s’assurer qu’il n’impacte aucun des sites Natura 2000 à proximité ni les espèces fragiles abritées par ceux-ci. C’est la raison pour laquelle une EIN est exigée. | ||
</p> |
19 changes: 19 additions & 0 deletions
19
envergo/templates/moulinette/natura2000/eval_env_soumis_systematique.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<p> | ||
<strong>Pourquoi le projet est-il concerné ?</strong> | ||
</p> | ||
|
||
<p> | ||
Au vu des informations saisies, le projet est soumis à évaluation environnementale systématique (<a href="#regulation_eval_env">voir section « Évaluation environnementale »</a>). | ||
</p> | ||
|
||
<p> | ||
Or, tout projet soumis à évaluation environnementale, <em>qu’il soit dans un site Natura 2000 ou non</em>, est automatiquement soumis à évaluation des incidences Natura 2000 (EIN). | ||
</p> | ||
|
||
<p> | ||
<strong>Quel impact environnemental ?</strong> | ||
</p> | ||
|
||
<p> | ||
Un projet est soumis à évaluation environnementale quand il est susceptible d’avoir des impacts significatifs sur l’environnement. En matière de biodiversité, le porteur d’un tel projet doit ainsi s’assurer qu’il n’impacte aucun des sites Natura 2000 à proximité ni les espèces fragiles abritées par ceux-ci. C’est la raison pour laquelle une EIN est exigée. | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.