Fixed syntax error in OSMWidget
This commit is contained in:
parent
973502c047
commit
6ecbac21a9
|
@ -111,5 +111,5 @@ class OSMWidget(BaseGeometryWidget):
|
|||
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})
|
||||
|
|
|
@ -244,6 +244,15 @@ class SpecializedFieldTest(SimpleTestCase):
|
|||
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):
|
||||
|
|
Loading…
Reference in New Issue