From 0e81f1124de4c29a469d5449a2f2e42548795e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Brunner?= Date: Tue, 4 Mar 2025 17:43:18 +0100 Subject: [PATCH] Don't alter the URL when adding the query --- geoportal/c2cgeoportal_geoportal/views/theme.py | 3 ++- .../tests/functional/test_themes_ogc_server_cache_clean.py | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/geoportal/c2cgeoportal_geoportal/views/theme.py b/geoportal/c2cgeoportal_geoportal/views/theme.py index a8a1d537a1..e53ac04efa 100644 --- a/geoportal/c2cgeoportal_geoportal/views/theme.py +++ b/geoportal/c2cgeoportal_geoportal/views/theme.py @@ -1,4 +1,4 @@ -# Copyright (c) 2011-2024, Camptocamp SA +# Copyright (c) 2011-2025, Camptocamp SA # All rights reserved. # Redistribution and use in source and binary forms, with or without @@ -897,6 +897,7 @@ async def _wfs_get_features_type( ) -> tuple[Optional[etree.Element], set[str]]: # pylint: disable=c-extension-no-member errors = set() + wfs_url = wfs_url.clone() wfs_url.add_query( { "SERVICE": "WFS", diff --git a/geoportal/tests/functional/test_themes_ogc_server_cache_clean.py b/geoportal/tests/functional/test_themes_ogc_server_cache_clean.py index b93520a5cb..be4a9828c7 100644 --- a/geoportal/tests/functional/test_themes_ogc_server_cache_clean.py +++ b/geoportal/tests/functional/test_themes_ogc_server_cache_clean.py @@ -1,4 +1,4 @@ -# Copyright (c) 2022-2024, Camptocamp SA +# Copyright (c) 2022-2025, Camptocamp SA # All rights reserved. # Redistribution and use in source and binary forms, with or without @@ -270,7 +270,7 @@ def test_ogc_server_cache_clean(self) -> None: "c2cgeoportal_geoportal.lib|_get_intranet_networks", } assert set(self.ogc_cache.keys()) == { - "c2cgeoportal_geoportal.views.theme|_get_features_attributes_cache|http://mapserver:8080/?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&ROLE_IDS=0&USER_ID=0|__test_ogc_server", + "c2cgeoportal_geoportal.views.theme|_get_features_attributes_cache|http://mapserver:8080/|__test_ogc_server", f"c2cgeoportal_geoportal.views.theme|build_web_map_service|{ogc_server.id}", "c2cgeoportal_geoportal.views.theme|do_get_http_cached|http://mapserver:8080/?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&ROLE_IDS=0&USER_ID=0", "c2cgeoportal_geoportal.views.theme|do_get_http_cached|http://mapserver:8080/?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities&ROLE_IDS=0&USER_ID=0", @@ -310,7 +310,7 @@ def test_ogc_server_cache_clean(self) -> None: "c2cgeoportal_geoportal.lib|_get_intranet_networks", } assert set(self.ogc_cache.keys()) == { - "c2cgeoportal_geoportal.views.theme|_get_features_attributes_cache|http://mapserver:8080/?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&ROLE_IDS=0&USER_ID=0|__test_ogc_server", + "c2cgeoportal_geoportal.views.theme|_get_features_attributes_cache|http://mapserver:8080/|__test_ogc_server", f"c2cgeoportal_geoportal.views.theme|build_web_map_service|{ogc_server.id}", "c2cgeoportal_geoportal.views.theme|do_get_http_cached|http://mapserver:8080/?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&ROLE_IDS=0&USER_ID=0", "c2cgeoportal_geoportal.views.theme|do_get_http_cached|http://mapserver:8080/?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities&ROLE_IDS=0&USER_ID=0",