예제 #1
0
    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
""")
예제 #2
0
 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""")