diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2014-09-27 00:57:29 +0300 |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2014-09-27 00:57:29 +0300 |
commit | fe21e4d4d76d3fd1efd16d124808d72a69588d7b (patch) | |
tree | 74e47a453633ae97d05f98cf18aeb361edb951e8 /Lib/test/test_email/test_email.py | |
parent | 081bbf6b28868774c1abca0a8469a517abb9f6cc (diff) | |
download | cpython-git-fe21e4d4d76d3fd1efd16d124808d72a69588d7b.tar.gz |
Issue #16324: _charset parameter of MIMEText now also accepts email.charset.Charset instances.
Initial patch by Claude Paroz.
Diffstat (limited to 'Lib/test/test_email/test_email.py')
-rw-r--r-- | Lib/test/test_email/test_email.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py index c3ecd0ab22..d16d4612ec 100644 --- a/Lib/test/test_email/test_email.py +++ b/Lib/test/test_email/test_email.py @@ -1636,6 +1636,10 @@ class TestMIMEText(unittest.TestCase): msg = MIMEText('hello there', _charset='us-ascii') 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')) + eq(msg.get_charset().input_charset, 'utf-8') + eq(msg['content-type'], 'text/plain; charset="utf-8"') def test_7bit_input(self): eq = self.assertEqual |