33
33
34
34
from test_qgsserver import QgsServerTestBase
35
35
from qgis .core import QgsProject
36
+ from qgis .server import QgsServerRequest
36
37
37
38
# Strip path and content length because path may vary
38
39
RE_STRIP_UNCHECKABLE = b'MAP=[^"]+|Content-Length: \d+'
@@ -302,7 +303,7 @@ def test_wms_getprint_opacity(self):
302
303
"REQUEST" : "GetPrint" ,
303
304
"TEMPLATE" : "layoutA4" ,
304
305
"FORMAT" : "png" ,
305
- "map0:EXTENT " : "-33626185.498,-13032965.185,33978427.737,16020257.031" ,
306
+ "map0%3AEXTENT " : "-33626185.498,-13032965.185,33978427.737,16020257.031" ,
306
307
"map0:LAYERS" : "Country,Hello" ,
307
308
"CRS" : "EPSG:3857" ,
308
309
"SELECTION" : "Country: 4" ,
@@ -313,22 +314,23 @@ def test_wms_getprint_opacity(self):
313
314
r , h = self ._result (self ._execute_request (qs ))
314
315
self ._img_diff_error (r , h , "WMS_GetPrint_Opacity" )
315
316
316
- qs = "?" + "&" .join (["%s=%s" % i for i in list ({
317
+ def test_wms_getprint_opacity_post (self ):
318
+ qs = "&" .join (["%s=%s" % i for i in list ({
317
319
"MAP" : urllib .parse .quote (self .projectPath ),
318
320
"SERVICE" : "WMS" ,
319
321
"VERSION" : "1.1.1" ,
320
322
"REQUEST" : "GetPrint" ,
321
323
"TEMPLATE" : "layoutA4" ,
322
324
"FORMAT" : "png" ,
323
- "map0:EXTENT " : "-33626185.498,-13032965.185,33978427.737,16020257.031" ,
325
+ "map0%3AEXTENT " : "-33626185.498,-13032965.185,33978427.737,16020257.031" ,
324
326
"map0:LAYERS" : "Country,Hello" ,
325
327
"CRS" : "EPSG:3857" ,
326
328
"SELECTION" : "Country: 4" ,
327
329
"LAYERS" : "Country,Hello" ,
328
330
"OPACITIES" : "125%2C125"
329
331
}.items ())])
330
332
331
- r , h = self ._result (self ._execute_request (qs ))
333
+ r , h = self ._result (self ._execute_request ('' , QgsServerRequest . PostMethod , data = qs . encode ( 'utf-8' ) ))
332
334
self ._img_diff_error (r , h , "WMS_GetPrint_Opacity" )
333
335
334
336
def test_wms_getprint_highlight (self ):
0 commit comments