Fixed a non-deterministic test; refs #23099.

This commit is contained in:
Tim Graham 2014-08-29 20:40:53 -04:00
parent 4926c0afe3
commit 135a58f9dc
1 changed files with 2 additions and 2 deletions

View File

@ -182,12 +182,12 @@ class DistanceTest(TestCase):
# Testing with spheroid distances first. # Testing with spheroid distances first.
hillsdale = AustraliaCity.objects.get(name='Hillsdale') hillsdale = AustraliaCity.objects.get(name='Hillsdale')
qs = AustraliaCity.objects.exclude(id=hillsdale.id).distance(hillsdale.point, spheroid=True) qs = AustraliaCity.objects.exclude(id=hillsdale.id).distance(hillsdale.point, spheroid=True).order_by('id')
for i, c in enumerate(qs): for i, c in enumerate(qs):
self.assertAlmostEqual(spheroid_distances[i], c.distance.m, tol) self.assertAlmostEqual(spheroid_distances[i], c.distance.m, tol)
if postgis: if postgis:
# PostGIS uses sphere-only distances by default, testing these as well. # PostGIS uses sphere-only distances by default, testing these as well.
qs = AustraliaCity.objects.exclude(id=hillsdale.id).distance(hillsdale.point) qs = AustraliaCity.objects.exclude(id=hillsdale.id).distance(hillsdale.point).order_by('id')
for i, c in enumerate(qs): for i, c in enumerate(qs):
self.assertAlmostEqual(sphere_distances[i], c.distance.m, tol) self.assertAlmostEqual(sphere_distances[i], c.distance.m, tol)