mock
¶
Classes:
-
MockSession–A variant of Session which stores sent messages in memory and is intended for use in test
Attributes:
-
LOG–
MockSession
¶
Bases: BaseSession
A variant of Session which stores sent messages in memory and is intended for use in test suites.
Attributes:
-
messages(list[tuple[str, Union[RawEmailMessage, EmailMessage]]]) –a list of tuples of message ids and messages in the order they were passed to send_email.
Methods:
-
send_email– -
assert_message_sent–Assert that a message which compares equal to the passed message was sent.
-
sent_message_from_id–Query a sent message by message id.
assert_message_sent
¶
Assert that a message which compares equal to the passed message was sent.
sent_message_from_id
¶
Query a sent message by message id.
Returns:
-
Union[EmailMessage, RawEmailMessage]–The sent message.
Raises:
-
KeyError–no matching message was found.