Filter out index scan for pymongo cache

This commit is contained in:
Ross Lawley
2013-06-05 10:42:41 +00:00
parent 940dfff625
commit 1a54dad643
2 changed files with 5 additions and 8 deletions

View File

@@ -631,14 +631,13 @@ class QuerySetTest(unittest.TestCase):
self.assertEqual(q, 1) # 1 for the insert
Blog.drop_collection()
Blog.ensure_indexes()
with query_counter() as q:
self.assertEqual(q, 0)
Blog.ensure_indexes()
self.assertEqual(q, 1)
Blog.objects.insert(blogs)
self.assertEqual(q, 3) # 1 for insert, and 1 for in bulk fetch (3 in total)
self.assertEqual(q, 2) # 1 for insert, and 1 for in bulk fetch
Blog.drop_collection()