Skip to content

Commit

Permalink
Merge pull request #84 from fladi/use_assertAlmostEqual_on_coords
Browse files Browse the repository at this point in the history
Assert that the coordinates are approximately equal instead of absolu…
  • Loading branch information
nemesifier committed Oct 29, 2015
2 parents 73ac3c0 + 59e900d commit 23b2651
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/django_restframework_gis_tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,8 @@ def test_post_location_list_EWKT(self):
expected_coords = (6.381495826183805, 53.384066927384985)
self.assertEqual(response.status_code, 201)
self.assertEqual(Location.objects.count(), 1)
self.assertEquals(
Location.objects.get(name='EWKT input test').geometry.coords,
expected_coords
)
for l, e in zip(Location.objects.get(name='EWKT input test').geometry.coords, expected_coords):
self.assertAlmostEqual(l, e, places=5)

def test_post_location_list_WKT_as_json(self):
self.assertEqual(Location.objects.count(), 0)
Expand Down

0 comments on commit 23b2651

Please sign in to comment.