From 458e2fbfcc0a06d7d55ff5a1dcd79c91c64e8138 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Tue, 11 Oct 2016 20:53:26 +0200 Subject: Fixed #27333 -- Prevented BASE64 encoding in message.as_string() on Python 3 Thanks Tim Graham for the review. --- tests/mail/tests.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests') diff --git a/tests/mail/tests.py b/tests/mail/tests.py index bc0d8eabc9..662cd7c6d6 100644 --- a/tests/mail/tests.py +++ b/tests/mail/tests.py @@ -572,6 +572,8 @@ class MailTests(HeadersCheckMixin, SimpleTestCase): ) s = msg.message().as_bytes() self.assertIn(b'Content-Transfer-Encoding: 8bit', s) + s = msg.message().as_string() + self.assertIn(str('Content-Transfer-Encoding: 8bit'), s) msg = EmailMessage( 'Subject', 'Body with non latin characters: А Б В Г Д Е Ж Ѕ З И І К Л М Н О П.', 'bounce@example.com', @@ -579,6 +581,8 @@ class MailTests(HeadersCheckMixin, SimpleTestCase): ) s = msg.message().as_bytes() self.assertIn(b'Content-Transfer-Encoding: 8bit', s) + s = msg.message().as_string() + self.assertIn(str('Content-Transfer-Encoding: 8bit'), s) def test_dont_base64_encode_message_rfc822(self): # Ticket #18967 -- cgit v1.3