@@ -115,45 +115,6 @@ def testGetFeatureInfo(self):
115
115
'info_format=InvalidFormat' ,
116
116
'wms_getfeatureinfo-invalid-format' )
117
117
118
- # Regression for #8656
119
- # Mind the gap! (the space in the FILTER expression)
120
- self .wms_request_compare ('GetFeatureInfo' ,
121
- '&layers=testlayer%20%C3%A8%C3%A9&' +
122
- 'INFO_FORMAT=text%2Fxml&' +
123
- 'width=600&height=400&srs=EPSG%3A3857&' +
124
- 'query_layers=testlayer%20%C3%A8%C3%A9&' +
125
- 'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib .parse .quote (':"NAME" = \' two\' ' ),
126
- 'wms_getfeatureinfo_filter' )
127
-
128
- # Test a filter with NO condition results
129
- self .wms_request_compare ('GetFeatureInfo' ,
130
- '&layers=testlayer%20%C3%A8%C3%A9&' +
131
- 'INFO_FORMAT=text%2Fxml&' +
132
- 'width=600&height=400&srs=EPSG%3A3857&' +
133
- 'query_layers=testlayer%20%C3%A8%C3%A9&' +
134
- 'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib .parse .quote (':"NAME" = \' two\' AND "utf8nameè" = \' no-results\' ' ),
135
- 'wms_getfeatureinfo_filter_no_results' )
136
-
137
- # Test a filter with OR condition results
138
- self .wms_request_compare ('GetFeatureInfo' ,
139
- '&layers=testlayer%20%C3%A8%C3%A9&' +
140
- 'INFO_FORMAT=text%2Fxml&' +
141
- 'width=600&height=400&srs=EPSG%3A3857&' +
142
- 'query_layers=testlayer%20%C3%A8%C3%A9&' +
143
- 'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib .parse .quote (':"NAME" = \' two\' OR "NAME" = \' three\' ' ),
144
- 'wms_getfeatureinfo_filter_or' )
145
-
146
- # Test a filter with OR condition and UTF results
147
- # Note that the layer name that contains utf-8 chars cannot be
148
- # to upper case.
149
- self .wms_request_compare ('GetFeatureInfo' ,
150
- '&layers=testlayer%20%C3%A8%C3%A9&' +
151
- 'INFO_FORMAT=text%2Fxml&' +
152
- 'width=600&height=400&srs=EPSG%3A3857&' +
153
- 'query_layers=testlayer%20%C3%A8%C3%A9&' +
154
- 'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib .parse .quote (':"NAME" = \' two\' OR "utf8nameè" = \' three èé↓\' ' ),
155
- 'wms_getfeatureinfo_filter_or_utf8' )
156
-
157
118
# Test feature info request with filter geometry
158
119
self .wms_request_compare ('GetFeatureInfo' ,
159
120
'&layers=testlayer%20%C3%A8%C3%A9&' +
@@ -206,6 +167,57 @@ def testGetFeatureInfo(self):
206
167
'wms_getfeatureinfo_notvisible' ,
207
168
'test_project_scalevisibility.qgs' )
208
169
170
+ def testGetFeatureInfoFilter (self ):
171
+ # Test getfeatureinfo response xml
172
+
173
+ # Regression for #8656
174
+ # Mind the gap! (the space in the FILTER expression)
175
+ self .wms_request_compare ('GetFeatureInfo' ,
176
+ '&layers=testlayer%20%C3%A8%C3%A9&' +
177
+ 'INFO_FORMAT=text%2Fxml&' +
178
+ 'width=600&height=400&srs=EPSG%3A3857&' +
179
+ 'query_layers=testlayer%20%C3%A8%C3%A9&' +
180
+ 'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib .parse .quote (':"NAME" = \' two\' ' ),
181
+ 'wms_getfeatureinfo_filter' )
182
+
183
+ # Test a filter with NO condition results
184
+ self .wms_request_compare ('GetFeatureInfo' ,
185
+ '&layers=testlayer%20%C3%A8%C3%A9&' +
186
+ 'INFO_FORMAT=text%2Fxml&' +
187
+ 'width=600&height=400&srs=EPSG%3A3857&' +
188
+ 'query_layers=testlayer%20%C3%A8%C3%A9&' +
189
+ 'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib .parse .quote (':"NAME" = \' two\' AND "utf8nameè" = \' no-results\' ' ),
190
+ 'wms_getfeatureinfo_filter_no_results' )
191
+
192
+ # Test a filter with OR condition results
193
+ self .wms_request_compare ('GetFeatureInfo' ,
194
+ '&layers=testlayer%20%C3%A8%C3%A9&' +
195
+ 'INFO_FORMAT=text%2Fxml&' +
196
+ 'width=600&height=400&srs=EPSG%3A3857&' +
197
+ 'query_layers=testlayer%20%C3%A8%C3%A9&' +
198
+ 'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib .parse .quote (':"NAME" = \' two\' OR "NAME" = \' three\' ' ),
199
+ 'wms_getfeatureinfo_filter_or' )
200
+
201
+ # Test a filter with OR condition and UTF results
202
+ # Note that the layer name that contains utf-8 chars cannot be
203
+ # to upper case.
204
+ self .wms_request_compare ('GetFeatureInfo' ,
205
+ '&layers=testlayer%20%C3%A8%C3%A9&' +
206
+ 'INFO_FORMAT=text%2Fxml&' +
207
+ 'width=600&height=400&srs=EPSG%3A3857&' +
208
+ 'query_layers=testlayer%20%C3%A8%C3%A9&' +
209
+ 'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib .parse .quote (':"NAME" = \' two\' OR "utf8nameè" = \' three èé↓\' ' ),
210
+ 'wms_getfeatureinfo_filter_or_utf8' )
211
+
212
+ # Regression #18292 Server GetFeatureInfo FILTER search fails when WIDTH, HEIGHT are not specified
213
+ self .wms_request_compare ('GetFeatureInfo' ,
214
+ '&layers=testlayer%20%C3%A8%C3%A9&' +
215
+ 'INFO_FORMAT=text%2Fxml&' +
216
+ 'srs=EPSG%3A3857&' +
217
+ 'query_layers=testlayer%20%C3%A8%C3%A9&' +
218
+ 'FEATURE_COUNT=10&FILTER=testlayer%20%C3%A8%C3%A9' + urllib .parse .quote (':"NAME" = \' two\' ' ),
219
+ 'wms_getfeatureinfo_filter_no_width' )
220
+
209
221
210
222
if __name__ == '__main__' :
211
223
unittest .main ()
0 commit comments