summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
Diffstat (limited to 'addons')
-rw-r--r--addons/web/tests/test_js.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/addons/web/tests/test_js.py b/addons/web/tests/test_js.py
index 0b1f8ed3763..49f5b8d6dce 100644
--- a/addons/web/tests/test_js.py
+++ b/addons/web/tests/test_js.py
@@ -4,6 +4,7 @@
import re
import odoo.tests
+RE_ONLY = re.compile('QUnit\.only\(')
class WebSuite(odoo.tests.HttpCase):
@@ -20,16 +21,18 @@ class WebSuite(odoo.tests.HttpCase):
def test_check_suite(self):
# verify no js test is using `QUnit.only` as it forbid any other test to be executed
- re_only = re.compile('QUnit\.only\(')
+ self._check_only_call('web.qunit_suite')
+ self._check_only_call('web.qunit_mobile_suite')
+ def _check_only_call(self, suite):
# As we currently aren't in a request context, we can't render `web.layout`.
# redefinied it as a minimal proxy template.
self.env.ref('web.layout').write({'arch_db': '<t t-name="web.layout"><t t-raw="head"/></t>'})
- for asset in self.env['ir.qweb']._get_asset_content('web.qunit_suite', options={})[0]:
+ for asset in self.env['ir.qweb']._get_asset_content(suite, options={})[0]:
filename = asset['filename']
if not filename or asset['atype'] != 'text/javascript':
continue
with open(filename, 'r') as fp:
- if re_only.search(fp.read()):
+ if RE_ONLY.search(fp.read()):
self.fail("`QUnit.only()` used in file %r" % asset['url'])