-
Notifications
You must be signed in to change notification settings - Fork 139
Un-hardcode message ID in test backend, and add console backend #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
`EmailMultiAlternatives.message()` serializes an email message for sending, and among other things adds a unique "Message-ID" header if one isn't already present. Use this in place of a hard-coded message ID in the test backend. For tests that inspect the message ID in the `anymail_status`, provide an explicit "Message-ID" header rather than using the ephemeral generated one.
Adds an EmailBackend derived from both Anymail's test backend and Django's console backend, to provide anymail statuses and signal handling while printing messages to the console. For use during development on localhost.
|
Thanks for this. I'm concerned that it's misleading to pull the Would it work to generate a sequential or random message_id in the test backend? Or maybe better for test reproducibility, generate a message_id based on |
|
That makes sense. The Moving away from Perhaps the implementation for generating a message ID really needs to be different between test and console/localhost development cases, where test message ID's are deterministic based on something like |
|
Yeah, none of the Anymail backends call If you want to do something different in the console backend to facilitate local development, you could override |
For the test EmailBackend, get message ID's based on array position in `mail.outbox`, so that tests can predict the message ID. For the console EmailBackend, use a uuid4 so that message ID's will be globally unique.
|
I've added a commit to use different strategies for acquiring a message ID on the The The |
|
Thanks! |
|
Oops, closes #85. |
Two commits to assist use in development: modify the test backend to use unique message ID's rather than a hardcoded
1. Also, add a console backend which provides anymail statuses and signal handling, while printing sent messages to the console.Re Issue #85.