mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
Issue #16324: _charset parameter of MIMEText now also accepts email.charset.Charset instances.
Initial patch by Claude Paroz.
This commit is contained in:
parent
081bbf6b28
commit
fe21e4d4d7
5 changed files with 16 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue