Fix $comment tests for MongoDB 3.1.x.
This commit is contained in:
parent
77de378c2a
commit
39c41b277e
@ -1052,9 +1052,12 @@ class TestCursor(IntegrationTest):
|
||||
|
||||
run_with_profiling(find)
|
||||
|
||||
# MongoDB 3.1.5 changed the ns for commands.
|
||||
regex = {'$regex': 'pymongo_test.(\$cmd|test)'}
|
||||
|
||||
def count():
|
||||
self.db.test.find().comment('foo').count()
|
||||
op = self.db.system.profile.find({'ns': 'pymongo_test.$cmd',
|
||||
op = self.db.system.profile.find({'ns': regex,
|
||||
'op': 'command',
|
||||
'command.count': 'test',
|
||||
'command.$comment': 'foo'})
|
||||
@ -1064,7 +1067,7 @@ class TestCursor(IntegrationTest):
|
||||
|
||||
def distinct():
|
||||
self.db.test.find().comment('foo').distinct('type')
|
||||
op = self.db.system.profile.find({'ns': 'pymongo_test.$cmd',
|
||||
op = self.db.system.profile.find({'ns': regex,
|
||||
'op': 'command',
|
||||
'command.distinct': 'test',
|
||||
'command.$comment': 'foo'})
|
||||
|
||||
Loading…
Reference in New Issue
Block a user