Skip to content

Commit c4a9541

Browse files
Add yet one assertion in test_set_text_charset_cp949
Check bytes(m), not only str(m).
1 parent ce916dc commit c4a9541

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

Lib/test/test_email/test_contentmanager.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,14 @@ def test_set_text_charset_cp949(self):
352352
353353
x9Gxub7uCoFBCg==
354354
"""))
355-
self.assertEqual(m.get_payload(decode=True).decode('ks_c_5601-1987'), content)
355+
self.assertEqual(bytes(m), textwrap.dedent("""\
356+
Content-Type: text/plain; charset="ks_c_5601-1987"
357+
Content-Transfer-Encoding: 8bit
358+
359+
\ud55c\uad6d\uc5b4
360+
\uac02
361+
""").encode('ks_c_5601-1987'))
362+
self.assertEqual(m.get_payload(decode=True), content.encode('ks_c_5601-1987'))
356363
self.assertEqual(m.get_content(), content)
357364

358365
def test_set_text_plain_long_line_heuristics(self):

0 commit comments

Comments
 (0)