Got within_box working for Geo fields
This commit is contained in:
parent
1c334141ee
commit
71689fcf23
3 changed files with 22 additions and 0 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue