Skip to content

Commit e56b08d

Browse files
author
A. Jesse Jiryu Davis
committed
Fix test_index_2dsphere for latest MongoDB
2.5 shows 'S2Cursor: BtreeCursor geo_2dsphere multi' in the explain output, not just 'S2Cursor'
1 parent 1615430 commit e56b08d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/test_collection.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,9 @@ def test_index_2dsphere(self):
416416
"coordinates": [[[40,5], [40,6], [41,6], [41,5], [40,5]]]}
417417
query = {"geo": {"$within": {"$geometry": poly}}}
418418

419-
self.assertEqual("S2Cursor",
420-
db.test.find(query).explain()['cursor'])
419+
self.assertTrue(
420+
db.test.find(query).explain()['cursor'].startswith('S2Cursor'))
421+
421422
db.test.drop_indexes()
422423

423424
def test_index_hashed(self):

0 commit comments

Comments
 (0)