Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add test coverage for this regression
  • Loading branch information
nirvn authored and github-actions[bot] committed Nov 6, 2021
1 parent 479f0f3 commit 0218d9b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/src/python/test_provider_spatialite.py
Expand Up @@ -1634,6 +1634,20 @@ def testTransactions(self):
self.assertEqual(vl.dataProvider().defaultValueClause(0), '')
self.assertEqual(vl.dataProvider().defaultValue(0), 1)

def testViewsExtentFilter(self):
"""Test extent filtering of a views-based spatialite layer"""

vl = QgsVectorLayer("dbname='%s' table=\"vs_controle_ok_nok\" (geom)" %
os.path.join(TEST_DATA_DIR, "views_test.sqlite"), "vs_controle_ok_nok", "spatialite")
self.assertTrue(vl.isValid())

feature = QgsFeature()
rect = QgsRectangle(822733, 6699265, 829351, 6707266)
it = vl.getFeatures(rect)
it.nextFeature(feature)

self.assertTrue(feature.isValid())


if __name__ == '__main__':
unittest.main()
Binary file added tests/testdata/views_test.sqlite
Binary file not shown.

0 comments on commit 0218d9b

Please sign in to comment.