Skip to content

Commit f97db93

Browse files
committed
corrected test for MongoDB 2.X
1 parent d367089 commit f97db93

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/document/indexes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -886,10 +886,10 @@ class TestChildDoc(TestDoc):
886886
index_info = TestDoc._get_collection().index_information()
887887
for key in index_info:
888888
del index_info[key]['v'] # drop the index version - we don't care about that here
889-
del index_info[key]['ns'] # drop the index namespace - we don't care about that here
889+
if 'ns' in index_info[key]:
890+
del index_info[key]['ns'] # drop the index namespace - we don't care about that here, MongoDB 3+
890891
if 'dropDups' in index_info[key]:
891892
del index_info[key]['dropDups'] # drop the index dropDups - it is deprecated in MongoDB 3+
892-
print index_info
893893

894894
self.assertEqual(index_info, {
895895
'txt_1': {

0 commit comments

Comments
 (0)