[IMP] base, http, web: do not start tests in debug mode

It seems to be a better solution to keep starting tests without being in debug
mode to avoid having new fields and menus appearing.

This commit simply drop the debug mode in test mode and retrieve the test
assets by checking if test mode is enabled directly.

closes odoo/odoo#34012

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit is contained in:
Romain Derie
2019-06-11 18:08:31 +00:00
parent 57d0ef5b0d
commit 33e0acb2ac
5 changed files with 5 additions and 6 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ var tour = require('web_tour.tour');
tour.register('stock', {
test: true,
url: '/web#action=stock.action_stock_config_settings',
url: '/web?debug=1#action=stock.action_stock_config_settings',
},
[
{
+1 -1
View File
@@ -394,7 +394,7 @@
</template>
<template id="conditional_assets_tests" name="Tests Assets Bundle">
<t t-call-assets="web.assets_tests" t-if="'tests' in debug" defer_load="True" />
<t t-call-assets="web.assets_tests" t-if="'tests' in debug or test_mode_enabled" defer_load="True" />
</template>
<template id="web.layout" name="Web layout">&lt;!DOCTYPE html&gt;
+1
View File
@@ -1357,6 +1357,7 @@ actual arch.
keep_query=keep_query,
request=request, # might be unbound if we're not in an httprequest context
debug=request.session.debug if request else '',
test_mode_enabled=bool(config['test_enable'] or config['test_file']),
json=json,
quote_plus=werkzeug.url_quote_plus,
time=time,
@@ -5,7 +5,7 @@ odoo.define('web.test.x2many', function (require) {
var inc;
tour.register('widget_x2many', {
url: '/web#action=test_new_api.action_discussions',
url: '/web?debug=1#action=test_new_api.action_discussions',
test: true,
}, [
/////////////////////////////////////////////////////////////////////////////////////////////
+1 -3
View File
@@ -1051,9 +1051,7 @@ class OpenERPSession(werkzeug.contrib.sessions.Session):
self.setdefault("login", None)
self.setdefault("session_token", None)
self.setdefault("context", {})
# Force tests debug mode when test mode enabled to load 'assets_tests'
test_mode = odoo.tools.config['test_enable'] or odoo.tools.config['test_file']
self.setdefault("debug", 'tests' if test_mode else '')
self.setdefault("debug", '')
def get_context(self):
"""