Skip to content

Commit 2d2906d

Browse files
committed
Add test for getting bytes payload with quoted-printable cte.
1 parent 46be53f commit 2d2906d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Lib/test/test_email/test_message.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,13 @@ def test_get_body_malformed(self):
10551055
# AttributeError: 'str' object has no attribute 'is_attachment'
10561056
m.get_body()
10571057

1058+
def test_get_bytes_payload_with_quoted_printable_encoding(self):
1059+
payload = b'Some payload'
1060+
m = self._make_message()
1061+
m.add_header('Content-Transfer-Encoding', 'quoted-printable')
1062+
m._payload = payload
1063+
self.assertEqual(m.get_payload(decode=True), payload)
1064+
10581065

10591066
class TestMIMEPart(TestEmailMessageBase, TestEmailBase):
10601067
# Doing the full test run here may seem a bit redundant, since the two

0 commit comments

Comments
 (0)