Skip to content

Commit

Permalink
Add test for Geometry type filter
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Mar 26, 2020
1 parent 667e5d9 commit 2ad92f2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/src/python/test_qgsproviderconnection_postgres.py
Expand Up @@ -69,6 +69,13 @@ def test_postgis_connections_from_uri(self):
rl = QgsRasterLayer(conn.tableUri('qgis_test', 'Raster1'), 'r1', 'postgresraster')
self.assertTrue(rl.isValid())

def test_postgis_geometry_filter(self):
"""Make sure the postgres provider only returns one matching geometry record and no polygons etc."""
vl = QgsVectorLayer(self.postgres_conn + ' srid=4326 type=POINT table="qgis_test"."geometries_table" (geom) sql=', 'test', 'postgres')

ids = [f.id() for f in vl.getFeatures()]
self.assertEqual(ids, [2])

def test_postgis_table_uri(self):
"""Create a connection from a layer uri and create a table URI"""

Expand Down

0 comments on commit 2ad92f2

Please sign in to comment.