summaryrefslogtreecommitdiff
path: root/odoo/tests/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'odoo/tests/common.py')
-rw-r--r--odoo/tests/common.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/odoo/tests/common.py b/odoo/tests/common.py
index 87a7889e4ec..c72832b4ad0 100644
--- a/odoo/tests/common.py
+++ b/odoo/tests/common.py
@@ -382,10 +382,12 @@ class BaseCase(TreeCase, MetaCase('DummyCase', (object,), {})):
expected = counters.get(login, default)
if flush:
self.env.user.flush()
+ self.env.cr.precommit()
count0 = self.cr.sql_log_count
yield
if flush:
self.env.user.flush()
+ self.env.cr.precommit()
count = self.cr.sql_log_count - count0
if count != expected:
# add some info on caller to allow semi-automatic update of query count
@@ -404,9 +406,11 @@ class BaseCase(TreeCase, MetaCase('DummyCase', (object,), {})):
# same operations, otherwise the caches might not be ready!
if flush:
self.env.user.flush()
+ self.env.cr.precommit()
yield
if flush:
self.env.user.flush()
+ self.env.cr.precommit()
def assertRecordValues(self, records, expected_values):
''' Compare a recordset with a list of dictionaries representing the expected results.