diff --git a/addons/test_website/tests/test_reset_views.py b/addons/test_website/tests/test_reset_views.py index a11e82824c3..5d0eeaa64de 100644 --- a/addons/test_website/tests/test_reset_views.py +++ b/addons/test_website/tests/test_reset_views.py @@ -5,7 +5,7 @@ import odoo.tests from odoo.tools import mute_logger -def break_view(view, fr='

placeholder

', to='

'): +def break_view(view, fr='

placeholder

', to='

'): view.arch = view.arch.replace(fr, to) @@ -44,8 +44,8 @@ class TestWebsiteResetViews(odoo.tests.HttpCase): def test_02_reset_specific_view_controller(self): total_views = self.View.search_count([('type', '=', 'qweb')]) # Trigger COW then break the QWEB XML on it - # `t-att-data="not.exist"` will test the case where exception.html contains branding - break_view(self.test_view.with_context(website_id=1), to='

') + # `t-att-data="no_record.exist"` will test the case where exception.html contains branding + break_view(self.test_view.with_context(website_id=1), to='

') self.assertEqual(total_views + 1, self.View.search_count([('type', '=', 'qweb')]), "Missing COW view") self.fix_it('/test_view') @@ -79,12 +79,12 @@ class TestWebsiteResetViews(odoo.tests.HttpCase): # self.assertEqual(total_views + 1, self.View.search_count([('type', '=', 'qweb')]), "Missing COW view (1)") # self.fix_it('/test_view') - # also mute ir.ui.view as `get_view_id()` will raise "Could not find view object with xml_id 'not.exist'"" + # also mute ir.ui.view as `get_view_id()` will raise "Could not find view object with xml_id 'no_record.exist'"" @mute_logger('odoo.addons.http_routing.models.ir_http', 'odoo.addons.website.models.ir_ui_view') def test_06_reset_specific_view_controller_inexisting_template(self): total_views = self.View.search_count([('type', '=', 'qweb')]) # Trigger COW then break the QWEB XML on it - break_view(self.test_view.with_context(website_id=1), to='') + break_view(self.test_view.with_context(website_id=1), to='') self.assertEqual(total_views + 1, self.View.search_count([('type', '=', 'qweb')]), "Missing COW view (2)") self.fix_it('/test_view') diff --git a/addons/web/models/ir_qweb.py b/addons/web/models/ir_qweb.py index 51694a3bc42..d68ff6ff971 100644 --- a/addons/web/models/ir_qweb.py +++ b/addons/web/models/ir_qweb.py @@ -4,6 +4,7 @@ import hashlib from collections import OrderedDict from werkzeug.urls import url_quote +from markupsafe import Markup as M from odoo import api, models from odoo.tools import pycompat @@ -105,7 +106,7 @@ class Image(models.AbstractModel): img.append('"') img.append('/>') - return u''.join(img) + return M(''.join(img)) class ImageUrlConverter(models.AbstractModel): _description = 'Qweb Field Image' diff --git a/addons/web/static/lib/qweb/qweb-test-attributes.xml b/addons/web/static/lib/qweb/qweb-test-attributes.xml index b599b76b629..e9f92a34ae7 100644 --- a/addons/web/static/lib/qweb/qweb-test-attributes.xml +++ b/addons/web/static/lib/qweb/qweb-test-attributes.xml @@ -5,9 +5,9 @@ ]]> - Test + Test - ]]> + ]]>

diff --git a/addons/web/static/lib/qweb/qweb-test-call.xml b/addons/web/static/lib/qweb/qweb-test-call.xml index 8cf1d1d657f..888026291d5 100644 --- a/addons/web/static/lib/qweb/qweb-test-call.xml +++ b/addons/web/static/lib/qweb/qweb-test-call.xml @@ -32,6 +32,27 @@ ok + +
+ + + + + +
]]> + + + +
+
+
+ + {"value": "ok"} + + +
ok
+ ]]>
+