def setUp(self): super(TemplatedHTMLEmailMessageViewTestCase, self).setUp() self.html_body = 'html body ✉️ 🙂 àäá.' self.html_body_template = template_from_string('{{ html }}') self.context['html'] = self.html_body self.render_html_body = functools.partial( self.message.render_html_body, context=self.context)
def setUp(self): self.message = self.message_class() self.subject = 'subject' self.subject_template = template_from_string( '{% autoescape off %}{{ subject }}{% endautoescape %}') self.body = 'body' self.body_template = template_from_string( '{% autoescape off %}{{ body }}{% endautoescape %}') self.context = { 'subject': self.subject, 'body': self.body, } self.render_subject = functools.partial(self.message.render_subject, context=self.context) self.render_body = functools.partial(self.message.render_body, context=self.context)