Skip to content
Permalink
Browse files
Add feature / change attribute value
  • Loading branch information
m-kuhn committed Nov 20, 2021
1 parent 9f54751 commit b64990dbb7190ab8a2ce3091ae9e1b32db854b96
Showing with 12 additions and 0 deletions.
  1. +12 −0 tests/src/python/test_provider_postgres.py
@@ -3537,6 +3537,18 @@ def testEwkt(self):
feature['geom'] = 'SRID=4326;Point (71 78)'
self.assertTrue(vl.updateFeature(feature))

# addFeature
feature['pk'] = 8
self.assertTrue(vl.addFeature(feature))

# changeAttributeValue
geom = QgsReferencedGeometry(QgsGeometry.fromWkt('POINT(3 3)'), QgsCoordinateReferenceSystem.fromEpsgId(4326))

feature['pk'] = 8
self.assertTrue(vl.changeAttributeValue(8, 8, geom))
self.assertEqual(vl.getFeature(8)['geom'].asWkt(), geom.asWkt())
self.assertEqual(vl.getFeature(8)['geom'].crs(), geom.crs())


if __name__ == '__main__':
unittest.main()

0 comments on commit b64990d

Please sign in to comment.