diff --git a/website_mail_qweb/tests/test_website_mail_qweb.py b/website_mail_qweb/tests/test_website_mail_qweb.py index aa9d7f5d..e9dd192e 100644 --- a/website_mail_qweb/tests/test_website_mail_qweb.py +++ b/website_mail_qweb/tests/test_website_mail_qweb.py @@ -2,6 +2,7 @@ # © 2017 Therp BV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp.tests.common import HttpCase +from ..controllers.main import UnquoteObject class TestWebsiteMailQweb(HttpCase): @@ -12,3 +13,16 @@ class TestWebsiteMailQweb(HttpCase): self.env.ref('email_template_qweb.email_template_demo1').id ) self.assertIn('Dear object.name,', result.read()) + + def test_unquote_object(self): + self.assertEqual(UnquoteObject('hello.world'), "hello.world") + self.assertEqual( + UnquoteObject('hello.world(42).test'), "hello.world(42).test" + ) + self.assertEqual( + UnquoteObject("hello.world(42, hello='42').test"), + "hello.world(42, hello='42').test" + ) + self.assertEqual( + UnquoteObject('hello.world[42].test'), "hello.world[42].test" + )