@@ -66,7 +66,7 @@ def testGetFeatureInfo(self):
6666 'query_layers=testlayer%20%C3%A8%C3%A9&X=190&Y=320' ,
6767 'wms_getfeatureinfo-text-html' )
6868
69- #Test getfeatureinfo response html with geometry
69+ # Test getfeatureinfo response html with geometry
7070 self .wms_request_compare ('GetFeatureInfo' ,
7171 '&layers=testlayer%20%C3%A8%C3%A9&styles=&' +
7272 'info_format=text%2Fhtml&transparent=true&' +
@@ -76,7 +76,7 @@ def testGetFeatureInfo(self):
7676 'with_geometry=true' ,
7777 'wms_getfeatureinfo-text-html-geometry' )
7878
79- #Test getfeatureinfo response html with maptip
79+ # Test getfeatureinfo response html with maptip
8080 self .wms_request_compare ('GetFeatureInfo' ,
8181 '&layers=testlayer%20%C3%A8%C3%A9&styles=&' +
8282 'info_format=text%2Fhtml&transparent=true&' +
@@ -167,6 +167,74 @@ def testGetFeatureInfo(self):
167167 'wms_getfeatureinfo_notvisible' ,
168168 'test_project_scalevisibility.qgs' )
169169
170+ # Test GetFeatureInfo resolves "value map" widget values
171+ mypath = self .testdata_path + "test_project_values.qgs"
172+ self .wms_request_compare ('GetFeatureInfo' ,
173+ '&layers=layer0&styles=&' +
174+ 'VERSION=1.3.0&' +
175+ 'info_format=text%2Fxml&' +
176+ 'width=926&height=787&srs=EPSG%3A4326' +
177+ '&bbox=912217,5605059,914099,5606652' +
178+ '&CRS=EPSG:3857' +
179+ '&FEATURE_COUNT=10' +
180+ '&QUERY_LAYERS=layer0&I=487&J=308' ,
181+ 'wms_getfeatureinfo-values1-text-xml' ,
182+ 'test_project_values.qgs' )
183+
184+ # TODO fix regression in QGIS 3 as the widget values don't get solved and enable test
185+ @unittest .expectedFailure
186+ def testGetFeatureInfoValueRelation (self ):
187+ """Test GetFeatureInfo resolves "value relation" widget values"""
188+ mypath = self .testdata_path + "test_project_values.qgs"
189+ self .wms_request_compare ('GetFeatureInfo' ,
190+ '&layers=layer1&styles=&' +
191+ 'VERSION=1.3.0&' +
192+ 'info_format=text%2Fxml&' +
193+ 'width=926&height=787&srs=EPSG%3A4326' +
194+ '&bbox=912217,5605059,914099,5606652' +
195+ '&CRS=EPSG:3857' +
196+ '&FEATURE_COUNT=10' +
197+ '&WITH_GEOMETRY=True' +
198+ '&QUERY_LAYERS=layer1&I=487&J=308' ,
199+ 'wms_getfeatureinfo-values1-text-xml' ,
200+ 'test_project_values.qgs' )
201+
202+ # TODO make GetFeatureInfo show the dictionary values and enable test
203+ @unittest .expectedFailure
204+ def testGetFeatureInfoValueRelationArray (self ):
205+ """Test GetFeatureInfo on "value relation" widget with array field (multiple selections)"""
206+ mypath = self .testdata_path + "test_project_values.qgs"
207+ self .wms_request_compare ('GetFeatureInfo' ,
208+ '&layers=layer3&styles=&' +
209+ 'VERSION=1.3.0&' +
210+ 'info_format=text%2Fxml&' +
211+ 'width=926&height=787&srs=EPSG%3A4326' +
212+ '&bbox=912217,5605059,914099,5606652' +
213+ '&CRS=EPSG:3857' +
214+ '&FEATURE_COUNT=10' +
215+ '&WITH_GEOMETRY=True' +
216+ '&QUERY_LAYERS=layer3&I=487&J=308' ,
217+ 'wms_getfeatureinfo-values3-text-xml' ,
218+ 'test_project_values.qgs' )
219+
220+ # TODO make GetFeatureInfo show what's in the display expression and enable test
221+ @unittest .expectedFailure
222+ def testGetFeatureInfoRelationReference (self ):
223+ """Test GetFeatureInfo solves "relation reference" widget "display expression" values"""
224+ mypath = self .testdata_path + "test_project_values.qgs"
225+ self .wms_request_compare ('GetFeatureInfo' ,
226+ '&layers=layer2&styles=&' +
227+ 'VERSION=1.3.0&' +
228+ 'info_format=text%2Fxml&' +
229+ 'width=926&height=787&srs=EPSG%3A4326' +
230+ '&bbox=912217,5605059,914099,5606652' +
231+ '&CRS=EPSG:3857' +
232+ '&FEATURE_COUNT=10' +
233+ '&WITH_GEOMETRY=True' +
234+ '&QUERY_LAYERS=layer2&I=487&J=308' ,
235+ 'wms_getfeatureinfo-values2-text-xml' ,
236+ 'test_project_values.qgs' )
237+
170238 def testGetFeatureInfoFilter (self ):
171239 # Test getfeatureinfo response xml
172240
0 commit comments