Skip to content
Permalink
Browse files
Have testNestedInsert use an editable layer, making it idempotent
Also have it commit changes to avoid leaving cursors open
  • Loading branch information
strk committed Oct 13, 2021
1 parent a336096 commit 51d728b2bf61b667933d48e22f974ba8f2203c12
Showing with 6 additions and 4 deletions.
  1. +6 −4 tests/src/python/test_provider_postgres.py
@@ -1146,13 +1146,15 @@ def onError(message):

def testNestedInsert(self):
tg = QgsTransactionGroup()
tg.addLayer(self.vl)
self.vl.startEditing()
it = self.vl.getFeatures()
l = self.getEditableLayer()
tg.addLayer(l)
l.startEditing()
it = l.getFeatures()
f = next(it)
f['pk'] = NULL
self.vl.addFeature(f) # Should not deadlock during an active iteration
self.assertTrue(l.addFeature(f)) # Should not deadlock during an active iteration
f = next(it)
l.commitChanges()

def testTimeout(self):
"""

0 comments on commit 51d728b

Please sign in to comment.