corrected index test for MongoDB 3+

This commit is contained in:
Matthieu Rigal 2015-05-07 10:47:09 +02:00
parent f4478fc762
commit 1005c99e9c

View File

@ -886,11 +886,14 @@ class IndexesTest(unittest.TestCase):
index_info = TestDoc._get_collection().index_information()
for key in index_info:
del index_info[key]['v'] # drop the index version - we don't care about that here
del index_info[key]['ns'] # drop the index namespace - we don't care about that here
if 'dropDups' in index_info[key]:
del index_info[key]['dropDups'] # drop the index dropDups - it is deprecated in MongoDB 3+
print index_info
self.assertEqual(index_info, {
'txt_1': {
'key': [('txt', 1)],
'dropDups': False,
'background': False
},
'_id_': {
@ -898,7 +901,6 @@ class IndexesTest(unittest.TestCase):
},
'txt2_1': {
'key': [('txt2', 1)],
'dropDups': False,
'background': False
},
'_cls_1': {