Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed syntax error in OSMWidget

  • Loading branch information...
commit 6ecbac21a9017a53fe18ac81c9c1d2f28185a292 1 parent 973502c
@claudep claudep authored
View
2  django/contrib/gis/forms/widgets.py
@@ -111,5 +111,5 @@ def map_srid(self):
return 900913
def render(self, name, value, attrs=None):
- return super(self, OSMWidget).render(name, value,
+ return super(OSMWidget, self).render(name, value,
{'default_lon': self.default_lon, 'default_lat': self.default_lat})
View
9 django/contrib/gis/tests/test_geoforms.py
@@ -244,6 +244,15 @@ class GeometryForm(forms.Form):
for invalid in [geom for key, geom in self.geometries.items() if key!='geometrycollection']:
self.assertFalse(GeometryForm(data={'g': invalid.wkt}).is_valid())
+ def test_osm_widget(self):
+ class PointForm(forms.Form):
+ p = forms.PointField(widget=forms.OSMWidget)
+
+ geom = self.geometries['point']
+ form = PointForm(data={'p': geom})
+ self.assertIn("OpenStreetMap (Mapnik)", form.as_p())
+
+
@skipUnless(HAS_GDAL and HAS_SPATIALREFSYS,
"CustomGeometryWidgetTest needs gdal support and a spatial database")
class CustomGeometryWidgetTest(SimpleTestCase):
Please sign in to comment.
Something went wrong with that request. Please try again.