From e4451ccaf8616e27c3479e97bcb75daf76396488 Mon Sep 17 00:00:00 2001 From: Erdenezul Batmunkh Date: Mon, 21 May 2018 09:22:33 +0800 Subject: [PATCH] insert_many uses only one insert --- tests/queryset/queryset.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tests/queryset/queryset.py b/tests/queryset/queryset.py index 50825e5c..8e91feae 100644 --- a/tests/queryset/queryset.py +++ b/tests/queryset/queryset.py @@ -845,11 +845,8 @@ class QuerySetTest(unittest.TestCase): blogs.append(Blog(title="post %s" % i, posts=[post1, post2])) Blog.objects.insert(blogs, load_bulk=False) - if mongodb_version < (2, 6): - self.assertEqual(q, 99) - else: - # profiling logs each doc now in the bulk op - self.assertEqual(q, 1) + # profiling logs each doc now in the bulk op + self.assertEqual(q, 99) Blog.drop_collection() Blog.ensure_indexes() @@ -861,8 +858,8 @@ class QuerySetTest(unittest.TestCase): if mongodb_version < (2, 6): self.assertEqual(q, 101) # 100 for insert, and 1 for in bulk fetch else: - # 99 for insert, and 1 for in bulk fetch - self.assertEqual(q, 100) + # 1 for insert, and 1 for in bulk fetch + self.assertEqual(q, 2) Blog.drop_collection()