[FIX] test_new_api, test_performance: lower query count

X-original-commit: 612b900fb99b26daba22eb25409f512a3a0cb2ea
This commit is contained in:
Xavier-Do
2020-06-03 13:00:35 +00:00
committed by Raphael Collet
parent 6afb4bb4e2
commit 1d0501d261
@@ -183,7 +183,7 @@ class One2manyCase(TransactionCase):
with self.assertQueryCount(0):
self.assertEqual(attachment.name, record0.display_name,
"field should be computed")
with self.assertQueryCount(2):
with self.assertQueryCount(1):
self.assertEqual(record0.attachment_ids, attachment, "inconsistent cache")
# creating a host should not attempt to recompute attachment.name
@@ -201,9 +201,9 @@ class One2manyCase(TransactionCase):
with self.assertQueryCount(0):
self.assertEqual(attachment.name, record1.display_name,
"field should be recomputed")
with self.assertQueryCount(2):
with self.assertQueryCount(1):
self.assertEqual(record1.attachment_ids, attachment, "inconsistent cache")
with self.assertQueryCount(2):
with self.assertQueryCount(1):
self.assertFalse(record0.attachment_ids, "inconsistent cache")
def test_recompute(self):