From f97db93212798c8ce1f766aaf45bd222b46be4b3 Mon Sep 17 00:00:00 2001 From: Matthieu Rigal Date: Thu, 7 May 2015 12:34:41 +0200 Subject: [PATCH] corrected test for MongoDB 2.X --- tests/document/indexes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/document/indexes.py b/tests/document/indexes.py index 54fd4ded..d43b22e5 100644 --- a/tests/document/indexes.py +++ b/tests/document/indexes.py @@ -886,10 +886,10 @@ 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 'ns' in index_info[key]: + del index_info[key]['ns'] # drop the index namespace - we don't care about that here, MongoDB 3+ 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': {