def test_parse_email(self): cm = Command() ret = cm.parse_email(multipart_maildata) textcontent = cm.get_content_with_type(ret) print ret['subject'].decode('iso-8859-1') self.assertEqual(ret['subject'], 'test 2') self.assertEqual(textcontent, """ Another Test! -öt """)
def _test_parse_email_html(self): cm = Command() ret = cm.parse_email(multipart_maildata) htmlcontent = cm.get_content_with_type(ret, 'text/html') self.assertEqual(htmlcontent, """\n<div dir="ltr">Another Test!<div><br></div><div>-öt</div></div>\n""")