MCPcopy
hub / github.com/django/django / get_raw_attachments

Method get_raw_attachments

tests/mail/tests.py:200–210  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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 """

Calls 3

message_from_bytesFunction · 0.85
as_bytesMethod · 0.80
messageMethod · 0.80

Tested by

no test coverage detected