Skip to content

Commit 7ce06e6

Browse files
committed
test with correct uniquevalue
1 parent 963fdd5 commit 7ce06e6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/src/python/test_qgsvectorlayerutils.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,10 @@ def testCreateFeature(self):
293293
self.assertEqual(f.attributes(), ['test_5', 131, NULL])
294294
layer.setDefaultValueDefinition(1, QgsDefaultValue(None))
295295

296+
# test with manually correct unique constraint
297+
f = QgsVectorLayerUtils.createFeature(layer, attributes={0: 'test_1', 1: 132})
298+
self.assertEqual(f.attributes(), ['test_5', 132, NULL])
299+
296300
def testDuplicateFeature(self):
297301
""" test duplicating a feature """
298302

0 commit comments

Comments
 (0)