diff --git a/src/providers/wfs/qgsbackgroundcachedshareddata.cpp b/src/providers/wfs/qgsbackgroundcachedshareddata.cpp index 0c7f61b1b3d3..c04098821aa2 100644 --- a/src/providers/wfs/qgsbackgroundcachedshareddata.cpp +++ b/src/providers/wfs/qgsbackgroundcachedshareddata.cpp @@ -642,6 +642,8 @@ void QgsBackgroundCachedSharedData::serializeFeatures( QVector( v.userType() ), fieldType ) ) cachedFeature.setAttribute( idx, v ); else diff --git a/tests/src/python/test_provider_wfs.py b/tests/src/python/test_provider_wfs.py index 1fff943a9bbe..bc385e4f3880 100644 --- a/tests/src/python/test_provider_wfs.py +++ b/tests/src/python/test_provider_wfs.py @@ -6277,6 +6277,7 @@ def testFilteredFeatureRequests(self): + @@ -6313,6 +6314,7 @@ def testFilteredFeatureRequests(self): 177 Xxx + true @@ -6344,6 +6346,7 @@ def testFilteredFeatureRequests(self): 177 Xxx + true @@ -6367,6 +6370,7 @@ def testFilteredFeatureRequests(self): 5 qgis + false 0 @@ -6412,6 +6416,31 @@ def testFilteredFeatureRequests(self): self.assertEqual(qgis_feat["name"], "qgis") self.assertEqual(other_feat["name"], "Xxx") + qgis_feat = next( + vl.getFeatures(QgsFeatureRequest(QgsExpression('"verified" is true'))) + ) + other_feat = next( + vl.getFeatures(QgsFeatureRequest(QgsExpression('"verified" is false'))) + ) + self.assertEqual(qgis_feat["name"], "Xxx") + self.assertEqual(other_feat["name"], "qgis") + + qgis_feat = next(vl.getFeatures(QgsFeatureRequest(QgsExpression('"verified"')))) + other_feat = next( + vl.getFeatures(QgsFeatureRequest(QgsExpression('not "verified"'))) + ) + self.assertEqual(qgis_feat["name"], "Xxx") + self.assertEqual(other_feat["name"], "qgis") + + qgis_feat = next( + vl.getFeatures(QgsFeatureRequest(QgsExpression('"verified" = true'))) + ) + other_feat = next( + vl.getFeatures(QgsFeatureRequest(QgsExpression('"verified" = false'))) + ) + self.assertEqual(qgis_feat["name"], "Xxx") + self.assertEqual(other_feat["name"], "qgis") + form_scope = QgsExpressionContextUtils.formScope(qgis_feat) form_exp = QgsExpression("current_value('name') = \"name\"") ctx = QgsExpressionContext()