(Cherry pick v7.2.1)

This commit is contained in:
medmunds
2020-08-05 11:44:14 -07:00
parent 85cec5e9dc
commit 48a9aaebf4
2 changed files with 22 additions and 0 deletions

View File

@@ -134,6 +134,15 @@ class AnymailInboundMessageConstructionTests(SimpleTestCase):
att = AnymailInboundMessage.construct_attachment(content_type="image/png", content=content, base64=True)
self.assertEqual(att.get_content_bytes(), SAMPLE_IMAGE_CONTENT)
def test_construct_attachment_unicode_filename(self):
# Issue #197
att = AnymailInboundMessage.construct_attachment(
content_type="text/plain", content="Unicode ✓", charset='utf-8', base64=False,
filename="Simulácia.txt", content_id="inline-id",)
self.assertEqual(att.get_filename(), "Simulácia.txt")
self.assertTrue(att.is_inline_attachment())
self.assertEqual(att.get_content_text(), "Unicode ✓")
def test_parse_raw_mime(self):
# (we're not trying to exhaustively test email.parser MIME handling here;
# just that AnymailInboundMessage.parse_raw_mime calls it correctly)