|
@ -2,6 +2,7 @@ |
|
|
# © 2017 Therp BV <http://therp.nl> |
|
|
# © 2017 Therp BV <http://therp.nl> |
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|
|
from openerp.tests.common import HttpCase |
|
|
from openerp.tests.common import HttpCase |
|
|
|
|
|
from ..controllers.main import UnquoteObject |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestWebsiteMailQweb(HttpCase): |
|
|
class TestWebsiteMailQweb(HttpCase): |
|
@ -12,3 +13,16 @@ class TestWebsiteMailQweb(HttpCase): |
|
|
self.env.ref('email_template_qweb.email_template_demo1').id |
|
|
self.env.ref('email_template_qweb.email_template_demo1').id |
|
|
) |
|
|
) |
|
|
self.assertIn('Dear object.name,', result.read()) |
|
|
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" |
|
|
|
|
|
) |