(self)
| 321 | # map_srid in openlayers.html template must not be localized. |
| 322 | @override_settings(USE_THOUSAND_SEPARATOR=True) |
| 323 | def test_pointfield(self): |
| 324 | class PointForm(forms.Form): |
| 325 | p = forms.PointField() |
| 326 | |
| 327 | geom = self.geometries["point"] |
| 328 | form = PointForm(data={"p": geom}) |
| 329 | self.assertTextarea(geom, form.as_p()) |
| 330 | self.assertMapWidget(form, "Point") |
| 331 | self.assertFalse(PointForm().is_valid()) |
| 332 | invalid = PointForm(data={"p": "some invalid geom"}) |
| 333 | self.assertFalse(invalid.is_valid()) |
| 334 | self.assertIn("Invalid geometry value", str(invalid.errors)) |
| 335 | |
| 336 | for invalid in [geo for key, geo in self.geometries.items() if key != "point"]: |
| 337 | self.assertFalse(PointForm(data={"p": invalid.wkt}).is_valid()) |
| 338 | |
| 339 | def test_multipointfield(self): |
| 340 | class PointForm(forms.Form): |
nothing calls this directly
no test coverage detected