'Check that changes are accurately noticed by OpenLayersWidget.'

def test_olwidget_has_changed(self):

    geoadmin = admin.site._registry[City]
    form = geoadmin.get_changelist_form(None)()
    has_changed = form.fields['point']._has_changed
    initial = Point(13.419745857296595, 52.51941085011498, srid=4326)
    data_same = 'SRID=3857;POINT(1493879.2754093995    6894592.019687599)'
    data_almost_same = 'SRID=3857;POINT(1493879.2754093990    6894592.019687590)'
    data_changed = 'SRID=3857;POINT(1493884.0527237    6894593.8111804)'
    self.assertTrue(has_changed(None, data_changed))
    self.assertTrue(has_changed(initial, ''))
    self.assertFalse(has_changed(None, ''))
    self.assertFalse(has_changed(initial, data_same))
    self.assertFalse(has_changed(initial, data_almost_same))
    self.assertTrue(has_changed(initial, data_changed))
