Browse Source

[ADD] explicit tests for UnquoteObject

pull/163/head
Holger Brunn 8 years ago
parent
commit
ca683af45d
No known key found for this signature in database GPG Key ID: 1C9760FECA3AE18
  1. 14
      website_mail_qweb/tests/test_website_mail_qweb.py

14
website_mail_qweb/tests/test_website_mail_qweb.py

@ -2,6 +2,7 @@
# © 2017 Therp BV <http://therp.nl>
# 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"
)
Loading…
Cancel
Save