[FIX] tests: do not assertQueries before warmup
Just like for `assertQueryCount`, we should not take into account queries that are not run after a warmup, for consistency. This allows to easily interchange both context managers for debugging purpose for instance. closes odoo/odoo#142450 X-original-commit: aaa1d287085c8b2fe20b6591ca9f1b5bbe65d3db Signed-off-by: Raphael Collet <rco@odoo.com> Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
@@ -482,6 +482,9 @@ class BaseCase(case.TestCase, metaclass=MetaCase):
|
||||
self.env.flush_all()
|
||||
self.env.cr.flush()
|
||||
|
||||
if not self.warm:
|
||||
return
|
||||
|
||||
self.assertEqual(
|
||||
len(actual_queries), len(expected),
|
||||
"\n---- actual queries:\n%s\n---- expected queries:\n%s" % (
|
||||
|
||||
Reference in New Issue
Block a user