From 1d0501d261bccaa2df1facdadfffe397225d30f8 Mon Sep 17 00:00:00 2001 From: Xavier-Do Date: Thu, 28 May 2020 18:06:40 +0000 Subject: [PATCH] [FIX] test_new_api, test_performance: lower query count X-original-commit: 612b900fb99b26daba22eb25409f512a3a0cb2ea --- odoo/addons/test_new_api/tests/test_one2many.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/odoo/addons/test_new_api/tests/test_one2many.py b/odoo/addons/test_new_api/tests/test_one2many.py index 4c06c8a9049..a2be1d9709e 100644 --- a/odoo/addons/test_new_api/tests/test_one2many.py +++ b/odoo/addons/test_new_api/tests/test_one2many.py @@ -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):