mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-19 19:32:05 +02:00
vanilla 17.0
This commit is contained in:
parent
d72e748793
commit
a9bcec8e91
1986 changed files with 1613876 additions and 568976 deletions
|
|
@ -2,7 +2,10 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
import re
|
||||
from contextlib import suppress
|
||||
|
||||
import odoo.tests
|
||||
from odoo.tools.misc import file_open
|
||||
from werkzeug.urls import url_quote_plus
|
||||
|
||||
RE_ONLY = re.compile(r'QUnit\.(only|debug)\(')
|
||||
|
|
@ -106,11 +109,12 @@ class WebSuite(WebsuiteCommon):
|
|||
|
||||
for asset in assets:
|
||||
filename = asset['filename']
|
||||
if not filename or asset['atype'] != 'text/javascript':
|
||||
if not filename.endswith('.js'):
|
||||
continue
|
||||
with open(filename, 'rb') as fp:
|
||||
if RE_ONLY.search(fp.read().decode('utf-8')):
|
||||
self.fail("`QUnit.only()` or `QUnit.debug()` used in file %r" % asset['url'])
|
||||
with suppress(FileNotFoundError):
|
||||
with file_open(filename, 'rb', filter_ext=('.js',)) as fp:
|
||||
if RE_ONLY.search(fp.read().decode('utf-8')):
|
||||
self.fail("`QUnit.only()` or `QUnit.debug()` used in file %r" % asset['url'])
|
||||
|
||||
|
||||
@odoo.tests.tagged('post_install', '-at_install')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue