Skip to content

Commit 62f7762

Browse files
committedJan 28, 2019
Add unit test for getfeatureinfo with alias in json
1 parent 3f38365 commit 62f7762

File tree

3 files changed

+584
-231
lines changed

3 files changed

+584
-231
lines changed
 

‎tests/src/python/test_qgsserver_wms_getfeatureinfo.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ def testGetFeatureInfoTolerance(self):
424424
'test_project_values.qgz')
425425

426426
def testGetFeatureInfoJSON(self):
427+
# simple test
427428
self.wms_request_compare('GetFeatureInfo',
428429
'&layers=testlayer%20%C3%A8%C3%A9&styles=&' +
429430
'info_format=application%2Fjson&transparent=true&' +
@@ -432,6 +433,15 @@ def testGetFeatureInfoJSON(self):
432433
'query_layers=testlayer%20%C3%A8%C3%A9&X=190&Y=320',
433434
'wms_getfeatureinfo_json')
434435

436+
# test with alias
437+
self.wms_request_compare('GetFeatureInfo',
438+
'&layers=testlayer%20%C3%A8%C3%A9%202&styles=&' +
439+
'info_format=application%2Fjson&transparent=true&' +
440+
'width=600&height=400&srs=EPSG%3A3857&bbox=913190.6389747962%2C' +
441+
'5606005.488876367%2C913235.426296057%2C5606035.347090538&' +
442+
'query_layers=testlayer%20%C3%A8%C3%A9%202&X=190&Y=320',
443+
'wms_getfeatureinfo_alias_json')
444+
435445
def testGetFeatureInfoPostgresTypes(self):
436446
# compare json list output with file
437447
self.wms_request_compare('GetFeatureInfo',

‎tests/testdata/qgis_server/test_project.qgs

Lines changed: 557 additions & 231 deletions
Large diffs are not rendered by default.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
*****
2+
Content-Type: application/json; charset=utf-8
3+
4+
{ "type": "FeatureCollection",
5+
"features":[
6+
{
7+
"type":"Feature",
8+
"id":2,
9+
"geometry":
10+
{"type": "Point", "coordinates": [8.203459, 44.901395]},
11+
"properties":{
12+
"alias_id":3,
13+
"alias_name":"three",
14+
"utf8nameè":"three èé↓"
15+
}
16+
}
17+
]}

0 commit comments

Comments
 (0)
Please sign in to comment.