summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_email
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2014-09-26 21:57:29 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2014-09-26 21:57:29 (GMT)
commitfe21e4d4d76d3fd1efd16d124808d72a69588d7b (patch)
tree74e47a453633ae97d05f98cf18aeb361edb951e8 /Lib/test/test_email
parent081bbf6b28868774c1abca0a8469a517abb9f6cc (diff)
downloadcpython-fe21e4d4d76d3fd1efd16d124808d72a69588d7b.zip
cpython-fe21e4d4d76d3fd1efd16d124808d72a69588d7b.tar.gz
cpython-fe21e4d4d76d3fd1efd16d124808d72a69588d7b.tar.bz2
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')
-rw-r--r--Lib/test/test_email/test_email.py4
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 c3ecd0ab..d16d461 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