(self)
| 1186 | self.assertEqual(image_att.get_filename(), "test.png") |
| 1187 | |
| 1188 | def test_attach_mime_part_in_constructor(self): |
| 1189 | image = MIMEPart() |
| 1190 | image.set_content( |
| 1191 | b"\x89PNG...", maintype="image", subtype="png", filename="test.png" |
| 1192 | ) |
| 1193 | email = EmailMessage(attachments=[image]) |
| 1194 | |
| 1195 | attachments = self.get_raw_attachments(email) |
| 1196 | self.assertEqual(len(attachments), 1) |
| 1197 | image_att = attachments[0] |
| 1198 | self.assertEqual(image_att.get_content_type(), "image/png") |
| 1199 | self.assertEqual(image_att.get_content(), b"\x89PNG...") |
| 1200 | self.assertEqual(image_att.get_content_disposition(), "attachment") |
| 1201 | self.assertEqual(image_att.get_filename(), "test.png") |
| 1202 | |
| 1203 | def test_attach_rfc822_message(self): |
| 1204 | """ |
nothing calls this directly
no test coverage detected