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.

17 lines
730 B

  1. # -*- coding: utf-8 -*-
  2. # © 2016 Therp BV <http://therp.nl>
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from openerp.tests.common import TransactionCase
  5. class TestMailTemplateQweb(TransactionCase):
  6. def test_email_template_qweb(self):
  7. template = self.env.ref('email_template_qweb.email_template_demo1')
  8. mail_values = template.generate_email([self.env.user.id])
  9. self.assertTrue(
  10. # this comes from the called template if everything worked
  11. '<footer>' in mail_values[self.env.user.id]['body_html'],
  12. 'Did not rcv rendered template in response. Got: \n%s\n' % (
  13. mail_values[self.env.user.id]['body_html']
  14. )
  15. )