mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-12 00:02:25 -04:00
Add unit test
This commit is contained in:
parent
e9463792e7
commit
ad2d0a28da
@ -1101,6 +1101,15 @@ class TestPyQgsPostgresProvider(unittest.TestCase, ProviderTestCase):
|
||||
|
||||
self.assertEqual(vl2.extent(), originalExtent)
|
||||
|
||||
def testDeterminePkey(self):
|
||||
"""Test primary key auto-determination"""
|
||||
|
||||
vl = QgsVectorLayer(self.dbconn + ' sslmode=disable srid=4326 type=POLYGON table="qgis_test"."authors" sql=', 'test', 'postgres')
|
||||
self.assertTrue(vl.isValid())
|
||||
self.assertTrue(vl.dataProvider().hasMetadata())
|
||||
self.assertTrue("key='pk'" in vl.source())
|
||||
|
||||
|
||||
def testCheckPkUnicityOnView(self):
|
||||
# vector layer based on view
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user