Exemplo n.º 1
0
    def test_msg_contains_html_body_and_attachment(self):
        e = Email('*****@*****.**', '*****@*****.**', 'subject')
        e.body = '<html><body><b>fubar</b></body></html>'
        e.body_is_html = True
        e.attachments.append(Attachment('./tests/440Hz-5sec.mp3'))

        # body will be base64 encoded:
        self.assertTrue('PGh0bWw+PGJvZHk+PGI+ZnViYXI8L2I+PC9ib2R5PjwvaHRtbD4='
                        in str(e)[:500])
        self.assertTrue('filename="440Hz' in str(e)[:800])
Exemplo n.º 2
0
    def test_msg_contains_html_body_and_attachment(self):
        e = Email('*****@*****.**', '*****@*****.**', 'subject')
        e.body = '<html><body><b>fubar</b></body></html>'
        e.body_is_html = True
        e.attachments.append(Attachment('./tests/440Hz-5sec.mp3'))

        # body will be base64 encoded:
        self.assertTrue('PGh0bWw+PGJvZHk+PGI+ZnViYXI8L2I+PC9ib2R5PjwvaHRtbD4='
                        in str(e)[:500])
        self.assertTrue('filename="440Hz' in str(e)[:800])
Exemplo n.º 3
0
 def test_as_string(self):
     e = Email('*****@*****.**', '*****@*****.**')
     e.subject = 'äää ööö üfoo äß'
     e.body = 'ääää'
     self.assertTrue('Content-Type: text/plain; charset="utf-8"' in str(e))
Exemplo n.º 4
0
 def test_as_string(self):
     e = Email('*****@*****.**', '*****@*****.**')
     e.subject = 'äää ööö üfoo äß'
     e.body = 'ääää'
     self.assertTrue('Content-Type: text/plain; charset="utf-8"' in str(e))