slight reordering of test code for clarity
This commit is contained in:
parent
608f08c267
commit
6cf0cf9e7d
@ -1379,6 +1379,12 @@ class QuerySetTest(unittest.TestCase):
|
|||||||
points = Point.objects(location__near_sphere=[-122, 37.5])
|
points = Point.objects(location__near_sphere=[-122, 37.5])
|
||||||
self.assertEqual(points.count(), 2)
|
self.assertEqual(points.count(), 2)
|
||||||
|
|
||||||
|
# Same behavior for _within_spherical_distance
|
||||||
|
points = Point.objects(
|
||||||
|
location__within_spherical_distance=[[-122, 37.5], 60/earth_radius]
|
||||||
|
);
|
||||||
|
self.assertEqual(points.count(), 2)
|
||||||
|
|
||||||
# Finds both points, but orders the north point first because it's
|
# Finds both points, but orders the north point first because it's
|
||||||
# closer to the reference point to the north.
|
# closer to the reference point to the north.
|
||||||
points = Point.objects(location__near_sphere=[-122, 38.5])
|
points = Point.objects(location__near_sphere=[-122, 38.5])
|
||||||
@ -1393,12 +1399,6 @@ class QuerySetTest(unittest.TestCase):
|
|||||||
self.assertEqual(points[0].id, south_point.id)
|
self.assertEqual(points[0].id, south_point.id)
|
||||||
self.assertEqual(points[1].id, north_point.id)
|
self.assertEqual(points[1].id, north_point.id)
|
||||||
|
|
||||||
# Same behavior for _within_spherical_distance
|
|
||||||
points = Point.objects(
|
|
||||||
location__within_spherical_distance=[[-122, 37.5], 60/earth_radius]
|
|
||||||
);
|
|
||||||
self.assertEqual(points.count(), 2)
|
|
||||||
|
|
||||||
# Finds only one point because only the first point is within 60km of
|
# Finds only one point because only the first point is within 60km of
|
||||||
# the reference point to the south.
|
# the reference point to the south.
|
||||||
points = Point.objects(
|
points = Point.objects(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user