[FIX] test_performance: query counts

This commit is contained in:
Raphael Collet
2020-08-18 13:02:41 +00:00
parent c6b0876fa6
commit 1a0feab95d
@@ -495,10 +495,10 @@ class TestIrPropertyOptimizations(TransactionCase):
self.Bacon.create({'property_eggs': False})
# create with another value
with self.assertQueryCount(5):
with self.assertQueryCount(3):
self.Bacon.with_context(default_property_eggs=eggs.id).create({})
with self.assertQueryCount(5):
with self.assertQueryCount(3):
self.Bacon.create({'property_eggs': eggs.id})
def test_with_truthy_default(self):
@@ -524,16 +524,16 @@ class TestIrPropertyOptimizations(TransactionCase):
eggs = self.Eggs.create({})
self.Bacon.create({'property_eggs': eggs.id})
with self.assertQueryCount(5):
with self.assertQueryCount(3):
self.Bacon.with_context(default_property_eggs=eggs.id).create({})
with self.assertQueryCount(5):
with self.assertQueryCount(3):
self.Bacon.create({'property_eggs': eggs.id})
with self.assertQueryCount(5):
with self.assertQueryCount(3):
self.Bacon.with_context(default_property_eggs=False).create({})
with self.assertQueryCount(5):
with self.assertQueryCount(3):
self.Bacon.create({'property_eggs': False})