Skip to content

Commit

Permalink
Make TestPyQgsPostgresProvider.testPktCompositeFloat idempotent
Browse files Browse the repository at this point in the history
References #45417
  • Loading branch information
strk committed Oct 13, 2021
1 parent 1221e61 commit 2a4ba7d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/src/python/test_provider_postgres.py
Expand Up @@ -902,6 +902,9 @@ def testPktCompositeFloat(self):
self.assertAlmostEqual(f['pk3'], 3.14159274)
self.assertEqual(f['value'], 'test 2')

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

# can we edit a field?
vl.startEditing()
vl.changeAttributeValue(f.id(), fields.indexOf('value'), 'Edited Test 2')
Expand Down Expand Up @@ -959,6 +962,9 @@ def testPktCompositeFloat(self):

self.assertFalse(got_feature)

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

def testPktFloatingPoint(self):
"""
Check if we can handle floating point/numeric primary keys correctly
Expand Down

0 comments on commit 2a4ba7d

Please sign in to comment.