You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
1.1 KiB
25 lines
1.1 KiB
# Copyright 2016 Therp BV <http://therp.nl>
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
from odoo.tests.common import TransactionCase
|
|
|
|
|
|
class TestMailTemplateQweb(TransactionCase):
|
|
def test_email_template_qweb(self):
|
|
template = self.env.ref('email_template_qweb.email_template_demo1')
|
|
mail_values = template.generate_email([self.env.user.id])
|
|
self.assertTrue(
|
|
# this comes from the called template if everything worked
|
|
'<footer>' in mail_values[self.env.user.id]['body_html'],
|
|
'Did not receive rendered template in response. Got: \n%s\n' % (
|
|
mail_values[self.env.user.id]['body_html']
|
|
)
|
|
)
|
|
# the same method is also called in a non multi mode
|
|
mail_values = template.generate_email(self.env.user.id)
|
|
self.assertTrue(
|
|
# this comes from the called template if everything worked
|
|
'<footer>' in mail_values['body_html'],
|
|
'Did not receive rendered template in response. Got: \n%s\n' % (
|
|
mail_values['body_html']
|
|
)
|
|
)
|