Cédric Krier pushed to branch branch/default at Tryton / Tryton
Commits:
a63b85de by Cédric Krier at 2023-02-18T22:50:42+01:00
Use proper _geometry_type to fill field definition
Closes #12083
- - - - -
6532eaaf by Cédric Krier at 2023-02-19T00:19:50+01:00
Test fields_get for GIS fields
- - - - -
2 changed files:
- trytond-gis/trytond_gis/fields.py
- trytond-gis/trytond_gis/tests/test_fields.py
Changes:
=====================================
trytond-gis/trytond_gis/fields.py
=====================================
@@ -55,7 +55,7 @@
def definition(self, model, language):
definition = super().definition(model, language)
definition['dimension'] = self.dimension
- definition['geometry_type'] = self.geometry_type
+ definition['geometry_type'] = self._geometry_type
return definition
=====================================
trytond-gis/trytond_gis/tests/test_fields.py
=====================================
@@ -15,6 +15,17 @@
activate_module('tests')
@with_transaction()
+ def test_fields_get(self):
+ "Test fields_get"
+ pool = Pool()
+
+ GISPoint = pool.get('test.gis.point')
+
+ self.assertDictContainsSubset(
+ {'dimension': 2, 'geometry_type': 'POINT'},
+ GISPoint.fields_get(['point'])['point'])
+
+ @with_transaction()
def test_create_save(self):
"Testing create/write with GIS types"
pool = Pool()
View it on Heptapod:
https://foss.heptapod.net/tryton/tryton/-/compare/ae6d8344d318000737543f73091d7ff11a3918ac...6532eaafaf401f5d94b7cb6b06a7dc1685e79fea
--
View it on Heptapod:
https://foss.heptapod.net/tryton/tryton/-/compare/ae6d8344d318000737543f73091d7ff11a3918ac...6532eaafaf401f5d94b7cb6b06a7dc1685e79fea
You're receiving this email because of your account on foss.heptapod.net.