diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2016-09-08 16:40:30 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2016-09-08 16:40:30 (GMT) |
commit | 2b2a9be9135be0135649a2a869856dbe4cc543f1 (patch) | |
tree | a6bd044be68769fe5f5ec96cea3554f8da89bfc9 /Lib/test | |
parent | 82733fac8dca465a1f0eb8e82b3b3f53cc6da145 (diff) | |
download | cpython-2b2a9be9135be0135649a2a869856dbe4cc543f1.zip cpython-2b2a9be9135be0135649a2a869856dbe4cc543f1.tar.gz cpython-2b2a9be9135be0135649a2a869856dbe4cc543f1.tar.bz2 |
Issue #27445: Don't pass str(_charset) to MIMEText.set_payload()
Patch by Claude Paroz.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_email/test_email.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py index 1e5366c..1d50feb 100644 --- a/Lib/test/test_email/test_email.py +++ b/Lib/test/test_email/test_email.py @@ -1652,9 +1652,12 @@ class TestMIMEText(unittest.TestCase): eq(msg.get_charset().input_charset, 'us-ascii') eq(msg['content-type'], 'text/plain; charset="us-ascii"') # Also accept a Charset instance - msg = MIMEText('hello there', _charset=Charset('utf-8')) + charset = Charset('utf-8') + charset.body_encoding = None + msg = MIMEText('hello there', _charset=charset) eq(msg.get_charset().input_charset, 'utf-8') eq(msg['content-type'], 'text/plain; charset="utf-8"') + eq(msg.get_payload(), 'hello there') def test_7bit_input(self): eq = self.assertEqual |