]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add yet one assertion in test_set_text_charset_cp949 (GH-151224)
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 10 Jun 2026 11:36:14 +0000 (14:36 +0300)
committerGitHub <noreply@github.com>
Wed, 10 Jun 2026 11:36:14 +0000 (14:36 +0300)
Check bytes(m), not only str(m).

Lib/test/test_email/test_contentmanager.py

index bc0e5d3561815917c3a434d6eafcd53744880ac2..0b1b6e89f8c99229106242e30f756476c9562b38 100644 (file)
@@ -352,7 +352,14 @@ class TestRawDataManager(TestEmailBase):
 
             x9Gxub7uCoFBCg==
             """))
-        self.assertEqual(m.get_payload(decode=True).decode('ks_c_5601-1987'), content)
+        self.assertEqual(bytes(m), textwrap.dedent("""\
+            Content-Type: text/plain; charset="ks_c_5601-1987"
+            Content-Transfer-Encoding: 8bit
+
+            \ud55c\uad6d\uc5b4
+            \uac02
+            """).encode('ks_c_5601-1987'))
+        self.assertEqual(m.get_payload(decode=True), content.encode('ks_c_5601-1987'))
         self.assertEqual(m.get_content(), content)
 
     def test_set_text_plain_long_line_heuristics(self):