mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
Patch #1449244: Support Unicode strings in
email.message.Message.{set_charset,get_content_charset}.
Will backport.
This commit is contained in:
parent
18c47f6a3b
commit
bdd0f39de5
3 changed files with 14 additions and 2 deletions
|
|
@ -502,6 +502,13 @@ class TestMessageAPI(TestEmailBase):
|
|||
msg.set_payload(x)
|
||||
self.assertEqual(msg.get_payload(decode=True), x)
|
||||
|
||||
def test_get_content_charset(self):
|
||||
msg = Message()
|
||||
msg.set_charset('us-ascii')
|
||||
self.assertEqual('us-ascii', msg.get_content_charset())
|
||||
msg.set_charset(u'us-ascii')
|
||||
self.assertEqual('us-ascii', msg.get_content_charset())
|
||||
|
||||
|
||||
|
||||
# Test the email.Encoders module
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue