Fix test_comment for MongoDB 3.5

This commit is contained in:
Bernie Hackett 2017-05-25 16:59:48 -07:00
parent c3dc1f4a8b
commit 3d49b2f5f6

View File

@ -1219,7 +1219,9 @@ self.assertFalse(c2.alive)
# MongoDB 3.1.5 changed the ns for commands.
regex = {'$regex': 'pymongo_test.(\$cmd|test)'}
if version.at_least(self.db.connection, (3, 1, 8, -1)):
if version.at_least(self.db.connection, (3, 5, 8, -1)):
query_key = "command.comment"
elif version.at_least(self.db.connection, (3, 1, 8, -1)):
query_key = "query.comment"
else:
query_key = "query.$comment"