Return a list of the raw attachment parts in the MIME message generated by serializing django_message and reparsing the result. This returns only "top-level" attachments. It will not descend into message/* attached emails to find nested attachments.
(self, django_message)
| 198 | return mail.outbox[index].message() |
| 199 | |
| 200 | def get_raw_attachments(self, django_message): |
| 201 | """ |
| 202 | Return a list of the raw attachment parts in the MIME message generated |
| 203 | by serializing django_message and reparsing the result. |
| 204 | |
| 205 | This returns only "top-level" attachments. It will not descend into |
| 206 | message/* attached emails to find nested attachments. |
| 207 | """ |
| 208 | msg_bytes = django_message.message().as_bytes() |
| 209 | message = message_from_bytes(msg_bytes) |
| 210 | return list(message.iter_attachments()) |
| 211 | |
| 212 | def get_decoded_attachments(self, django_message): |
| 213 | """ |
no test coverage detected