From aedfe0ddd76fc37c83341c35c79ab63330ffded8 Mon Sep 17 00:00:00 2001 From: kalombo Date: Fri, 7 Apr 2017 17:54:50 -0400 Subject: [PATCH] Tested EmailMessage(attachments=[MIMEText]) --- tests/mail/tests.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/mail/tests.py b/tests/mail/tests.py index 2527932997..05fe61026f 100644 --- a/tests/mail/tests.py +++ b/tests/mail/tests.py @@ -374,6 +374,12 @@ class MailTests(HeadersCheckMixin, SimpleTestCase): self.assertEqual(payload[0].get_content_type(), 'multipart/alternative') self.assertEqual(payload[1].get_content_type(), 'application/pdf') + def test_attachments_MIMEText(self): + txt = MIMEText('content1') + msg = EmailMessage(attachments=[txt]) + payload = msg.message().get_payload() + self.assertEqual(payload[0], txt) + def test_non_ascii_attachment_filename(self): """Regression test for #14964""" headers = {"Date": "Fri, 09 Nov 2001 01:08:47 -0000", "Message-ID": "foo"}