(self)
| 38 | ) |
| 39 | |
| 40 | def test_widget_has_changed(self): |
| 41 | geoadmin = self.admin_site.get_model_admin(City) |
| 42 | form = geoadmin.get_changelist_form(None)() |
| 43 | has_changed = form.fields["point"].has_changed |
| 44 | |
| 45 | initial = Point(13.4197458572965953, 52.5194108501149799, srid=4326) |
| 46 | data_same = "SRID=3857;POINT(1493879.2754093995 6894592.019687599)" |
| 47 | data_almost_same = "SRID=3857;POINT(1493879.2754093990 6894592.019687590)" |
| 48 | data_changed = "SRID=3857;POINT(1493884.0527237 6894593.8111804)" |
| 49 | |
| 50 | self.assertIs(has_changed(None, data_changed), True) |
| 51 | self.assertIs(has_changed(initial, ""), True) |
| 52 | self.assertIs(has_changed(None, ""), False) |
| 53 | self.assertIs(has_changed(initial, data_same), False) |
| 54 | self.assertIs(has_changed(initial, data_almost_same), False) |
| 55 | self.assertIs(has_changed(initial, data_changed), True) |
| 56 | |
| 57 | |
| 58 | class GISAdminTests(GeoAdminTest): |
nothing calls this directly
no test coverage detected