Пример #1
0
    def test_multipart_message(self):
        msg = EmailMessage('*****@*****.**', '*****@*****.**', 'subject')
        msg.add_inline_attachment('body')
        self.assertEqualDiff(SIMPLE_MULTIPART_MESSAGE, msg.as_string(BOUNDARY))

        msg = EmailMessage('*****@*****.**', '*****@*****.**', 'subject', 'body')
        msg.add_inline_attachment(u'a\nb\nc\nd\ne\n', 'lines.txt', 'x-subtype')
        self.assertEqualDiff(COMPLEX_MULTIPART_MESSAGE % 'x-subtype',
                msg.as_string(BOUNDARY))
Пример #2
0
    def test_multipart_message(self):
        msg = EmailMessage('*****@*****.**', '*****@*****.**', 'subject')
        msg.add_inline_attachment('body')
        self.assertEqualDiff(SIMPLE_MULTIPART_MESSAGE, msg.as_string(BOUNDARY))

        msg = EmailMessage('*****@*****.**', '*****@*****.**', 'subject', 'body')
        msg.add_inline_attachment(u'a\nb\nc\nd\ne\n', 'lines.txt', 'x-subtype')
        self.assertEqualDiff(COMPLEX_MULTIPART_MESSAGE % 'x-subtype',
                             msg.as_string(BOUNDARY))
Пример #3
0
 def test_multipart_message_complex(self):
     msg = EmailMessage('*****@*****.**', '*****@*****.**', 'subject', 'body')
     msg.add_inline_attachment(u'a\nb\nc\nd\ne\n', 'lines.txt', 'x-subtype')
     self.assertEqualDiff(complex_multipart_message('x-subtype'),
                          msg.as_string(BOUNDARY))
Пример #4
0
 def test_multipart_message_simple(self):
     msg = EmailMessage('*****@*****.**', '*****@*****.**', 'subject')
     msg.add_inline_attachment('body')
     self.assertEqualDiff(simple_multipart_message(),
                          msg.as_string(BOUNDARY))
Пример #5
0
 def test_multipart_message_complex(self):
     msg = EmailMessage('*****@*****.**', '*****@*****.**', 'subject', 'body')
     msg.add_inline_attachment(u'a\nb\nc\nd\ne\n', 'lines.txt', 'x-subtype')
     self.assertEqualDiff(complex_multipart_message('x-subtype'),
                          msg.as_string(BOUNDARY))
Пример #6
0
 def test_multipart_message_simple(self):
     msg = EmailMessage('*****@*****.**', '*****@*****.**', 'subject')
     msg.add_inline_attachment('body')
     self.assertEqualDiff(simple_multipart_message(),
                          msg.as_string(BOUNDARY))