diff --git a/test/test_get_feature_info.py b/test/test_get_feature_info.py index d3bc80b4..e21e32c8 100644 --- a/test/test_get_feature_info.py +++ b/test/test_get_feature_info.py @@ -239,7 +239,7 @@ def test_single_get_feature_info_ascii(client): "FILTER": "accents:\"NAME_1\" = 'Bret\\'agne'", } - rv = client.get(_build_query_string(qs, use_urllib3=True), PROJECT) + rv = client.get(_build_query_string(qs, use_urllib=True), PROJECT) data = _check_request(rv) if Qgis.QGIS_VERSION_INT <= 31700: diff --git a/test/utils.py b/test/utils.py index ec95397d..08c511d5 100644 --- a/test/utils.py +++ b/test/utils.py @@ -8,7 +8,7 @@ from PIL import Image from qgis.server import QgsBufferServerResponse -from urllib3 import request +from urllib.parse import urlencode __copyright__ = 'Copyright 2024, 3Liz' __license__ = 'GPL version 3' @@ -58,10 +58,10 @@ def xpath_text(self, path: str) -> str: return ' '.join(e.text for e in self.xpath(path)) -def _build_query_string(params: dict, use_urllib3: bool=False) -> str: +def _build_query_string(params: dict, use_urllib: bool = False) -> str: """ Build a query parameter from a dictionary. """ - if use_urllib3: - return "?" + request.urlencode(params) + if use_urllib: + return "?" + urlencode(params) query_string = '?' for k, v in params.items():