diff options
| author | Sergey Fedoseev <fedoseev.sergey@gmail.com> | 2017-03-21 18:04:41 +0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-03-21 09:04:41 -0400 |
| commit | 816c5753ac554b2af710aebc98ad60fd5823e03f (patch) | |
| tree | eb416dcd5b6c931d23c85ddcf22e7d5823994c34 /tests | |
| parent | 88c003c2bd9e0af08740612050c78dd94e317ddd (diff) | |
Fixed #27965 -- Fixed precision comparison in a geoforms test (refs #27939).
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/gis_tests/test_geoforms.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/gis_tests/test_geoforms.py b/tests/gis_tests/test_geoforms.py index eaa19ac3ef..473cf13913 100644 --- a/tests/gis_tests/test_geoforms.py +++ b/tests/gis_tests/test_geoforms.py @@ -1,4 +1,3 @@ -import json import re from django.contrib.gis import forms @@ -115,8 +114,9 @@ class GeometryFieldTest(SimpleTestCase): # The first point can't use assertInHTML() due to non-deterministic # ordering of the rendered dictionary. pt1_serialized = re.search(r'<textarea [^>]*>({[^<]+})<', output).groups()[0] - pt1_json = json.loads(pt1_serialized.replace('"', '"')) - self.assertEqual(pt1_json, {'coordinates': [812632.2827908975, 5465442.183322753], 'type': 'Point'}) + pt1_json = pt1_serialized.replace('"', '"') + pt1_expected = GEOSGeometry(form.data['pt1']).transform(3857, clone=True) + self.assertJSONEqual(pt1_json, pt1_expected.json) self.assertInHTML( '<textarea id="id_pt2" class="vSerializedField required" cols="150"' |
