diff options
author | R David Murray <rdmurray@bitdance.com> | 2011-04-06 12:16:13 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2011-04-06 12:16:13 (GMT) |
commit | a0b1c77a19ecfe58d34d10ba4b60f9bb4ad217f0 (patch) | |
tree | 7b80b7cdfed5c23f809e30664cf1f8262bf736eb /Lib/test/test_email/test_email.py | |
parent | 736975a77168aa90ab4b5bb1e56c31fd3ab26934 (diff) | |
parent | c5c147289556d9941876bb4b209412ad52731eb0 (diff) | |
download | cpython-a0b1c77a19ecfe58d34d10ba4b60f9bb4ad217f0.zip cpython-a0b1c77a19ecfe58d34d10ba4b60f9bb4ad217f0.tar.gz cpython-a0b1c77a19ecfe58d34d10ba4b60f9bb4ad217f0.tar.bz2 |
Merge #11605: don't use set/get_payload in feedparser; they do conversions.
Diffstat (limited to 'Lib/test/test_email/test_email.py')
-rw-r--r-- | Lib/test/test_email/test_email.py | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py index 3d86b6a..44acc9f 100644 --- a/Lib/test/test_email/test_email.py +++ b/Lib/test/test_email/test_email.py @@ -3143,6 +3143,53 @@ class Test8BitBytesHandling(unittest.TestCase): g = email.generator.BytesGenerator(s) g.flatten(msg, linesep='\r\n') self.assertEqual(s.getvalue(), text) + + def test_8bit_multipart(self): + # Issue 11605 + source = textwrap.dedent("""\ + Date: Fri, 18 Mar 2011 17:15:43 +0100 + To: foo@example.com + From: foodwatch-Newsletter <bar@example.com> + Subject: Aktuelles zu Japan, Klonfleisch und Smiley-System + Message-ID: <76a486bee62b0d200f33dc2ca08220ad@localhost.localdomain> + MIME-Version: 1.0 + Content-Type: multipart/alternative; + boundary="b1_76a486bee62b0d200f33dc2ca08220ad" + + --b1_76a486bee62b0d200f33dc2ca08220ad + Content-Type: text/plain; charset="utf-8" + Content-Transfer-Encoding: 8bit + + Guten Tag, , + + mit großer Betroffenheit verfolgen auch wir im foodwatch-Team die + Nachrichten aus Japan. + + + --b1_76a486bee62b0d200f33dc2ca08220ad + Content-Type: text/html; charset="utf-8" + Content-Transfer-Encoding: 8bit + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" + "http://www.w3.org/TR/html4/loose.dtd"> + <html lang="de"> + <head> + <title>foodwatch - Newsletter</title> + </head> + <body> + <p>mit großer Betroffenheit verfolgen auch wir im foodwatch-Team + die Nachrichten aus Japan.</p> + </body> + </html> + --b1_76a486bee62b0d200f33dc2ca08220ad-- + + """).encode('utf-8') + msg = email.message_from_bytes(source) + s = BytesIO() + g = email.generator.BytesGenerator(s) + g.flatten(msg) + self.assertEqual(s.getvalue(), source) + maxDiff = None |