diff --git a/backend/dependencies/RefGeo b/backend/dependencies/RefGeo index f0c09f46eb..75ecd59986 160000 --- a/backend/dependencies/RefGeo +++ b/backend/dependencies/RefGeo @@ -1 +1 @@ -Subproject commit f0c09f46eb4598ad93b5635f5ce63e289a5df75c +Subproject commit 75ecd59986b574d5c28742fd6d9b00e57b34e38b diff --git a/backend/geonature/tests/benchmarks/test_benchmark_ref_geo.py b/backend/geonature/tests/benchmarks/test_benchmark_ref_geo.py new file mode 100644 index 0000000000..d1ce75d6c9 --- /dev/null +++ b/backend/geonature/tests/benchmarks/test_benchmark_ref_geo.py @@ -0,0 +1,38 @@ +import logging +import pytest +from geonature.tests.benchmarks import * + +from .benchmark_generator import BenchmarkTest, CLater + +from .utils import activate_profiling_sql + +logging.basicConfig() +logger = logging.getLogger("logger-name") +logger.setLevel(logging.DEBUG) + +from .utils import CLIENT_GET + + +@pytest.mark.benchmark(group="ref_geo") +@pytest.mark.usefixtures("client_class", "temporary_transaction", "activate_profiling_sql") +class TestBenchmarkRefGeo: + + test_get_areas_with_geom = BenchmarkTest( + CLIENT_GET, + [ + CLater( + """url_for("ref_geo.get_areas", without_geom="false", type_code=["REG", "DEP", "COM"])""" + ) + ], + dict(user_profile="admin_user", fixtures=[]), + )() + + test_get_areas_without_geom = BenchmarkTest( + CLIENT_GET, + [ + CLater( + """url_for("ref_geo.get_areas", without_geom="true", type_code=["REG", "DEP", "COM"])""" + ) + ], + dict(user_profile="admin_user", fixtures=[]), + )()