Skip to content
Permalink
Browse files
Make TestPyQgsPostgresProvider.testPktUpdateBigintPk idempotent
References #45417
  • Loading branch information
strk committed Oct 13, 2021
1 parent b36d2f4 commit 2b9717f2c1b74fb7a1ffe27eb89c1637f1355511
Showing with 6 additions and 0 deletions.
  1. +6 −0 tests/src/python/test_provider_postgres.py
@@ -720,6 +720,9 @@ def testPktUpdateBigintPk(self):
"bigint_pk", "postgres")
flds = vl.fields()

# Backup test table (will be edited)
self.backupTable('qgis_test', 'bigint_pk')

self.assertTrue(vl.isValid())

vl.startEditing()
@@ -763,6 +766,9 @@ def testPktUpdateBigintPk(self):
statuses[3] = 1
self.assertTrue(all(x == 1 for x in statuses))

# Restore test table
self.restoreTable('qgis_test', 'bigint_pk')

def testPktUpdateBigintPkNonFirst(self):
"""Test if we can update objects with positive, zero and negative bigint PKs in tables whose PK is not the first field"""
vl = QgsVectorLayer('{} sslmode=disable srid=4326 key="pk" table="qgis_test".{} (geom)'.format(self.dbconn,

0 comments on commit 2b9717f

Please sign in to comment.