Skip to content

Commit

Permalink
Add feature / change attribute value
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Nov 20, 2021
1 parent 9f54751 commit b64990d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/src/python/test_provider_postgres.py
Expand Up @@ -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.