Got within_box working for Geo fields

This commit is contained in:
Harry Marr
2010-07-07 15:00:46 +01:00
parent 1c334141ee
commit 71689fcf23
3 changed files with 22 additions and 0 deletions

View File

@@ -1232,6 +1232,12 @@ class QuerySetTest(unittest.TestCase):
events = events.order_by("-date")
self.assertEqual(events.count(), 2)
self.assertEqual(events[0], event3)
# check that within_box works
box = [(35.0, -125.0), (40.0, -100.0)]
events = Event.objects(location__within_box=box)
self.assertEqual(events.count(), 1)
self.assertEqual(events[0].id, event2.id)
Event.drop_collection()