Skip to content

Commit

Permalink
Make TestPyQgsPostgresProvider.testGeneratedColumns idempotent
Browse files Browse the repository at this point in the history
Closes #45414
  • Loading branch information
strk authored and nyalldawson committed Oct 5, 2021
1 parent 9f49c0d commit 989b651
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/src/python/providertestbase.py
Expand Up @@ -1233,3 +1233,9 @@ def testGeneratedColumns(self):
self.assertEqual(feature.attribute(1), "test:8")
self.assertFalse(QgsVectorLayerUtils.fieldIsEditable(vl, 1, feature))
self.assertFalse(QgsVectorLayerUtils.fieldIsEditable(vl, 0, feature))

# CLEANUP: delete features added during test (cleanup)
vl.startEditing()
self.assertTrue(vl.deleteFeature(10))
self.assertTrue(vl.commitChanges())
# TODO: further cleanups in case attributes have been changed

0 comments on commit 989b651

Please sign in to comment.