summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiannis Adamopoulos <gadamopoulos@outlook.com>2020-11-28 08:58:40 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-11-28 09:14:40 +0100
commit9175a2cc3248acf1f17c845d6c336ec9bba109f8 (patch)
treed3a5214ad1e7eef34b47ee47ef49a81ad06ec171
parent931c6e982c078073dfa9b5dc1ef0059f8c787719 (diff)
Added assertion for geom_type in BaseGeometryWidget.get_context().
-rw-r--r--tests/gis_tests/test_geoforms.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/gis_tests/test_geoforms.py b/tests/gis_tests/test_geoforms.py
index 0360156b50..74c082e59d 100644
--- a/tests/gis_tests/test_geoforms.py
+++ b/tests/gis_tests/test_geoforms.py
@@ -374,10 +374,14 @@ class OSMWidgetTest(SimpleTestCase):
class GeometryWidgetTests(SimpleTestCase):
def test_get_context_attrs(self):
- """The Widget.get_context() attrs argument overrides self.attrs."""
+ # The Widget.get_context() attrs argument overrides self.attrs.
widget = BaseGeometryWidget(attrs={'geom_type': 'POINT'})
context = widget.get_context('point', None, attrs={'geom_type': 'POINT2'})
self.assertEqual(context['geom_type'], 'POINT2')
+ # Widget.get_context() returns expected name for geom_type.
+ widget = BaseGeometryWidget(attrs={'geom_type': 'POLYGON'})
+ context = widget.get_context('polygon', None, None)
+ self.assertEqual(context['geom_type'], 'Polygon')
def test_subwidgets(self):
widget = forms.BaseGeometryWidget()