-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
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
Fixed #35528 -- Added helper method EmailMultiAlternatives.body_contains(). #18278
Fixed #35528 -- Added helper method EmailMultiAlternatives.body_contains(). #18278
Conversation
@sarahboyce Here's my first draft. Is this going in the desired direction? |
Yes, let's also raise a ticket on Trac 👍 I wonder if we want it to have a |
Thx @sarahboyce !
Am I supposed to do this? (Which I can surely do!)
I was wondering about where to put the docs since there is no detailed page for this class.
Is this documented somewhere? Every project does things differently...
Sounds good to me. Should I start implementing or do we want to gather some more opinions on this? |
Yes please
Maybe in here: https://docs.djangoproject.com/en/5.0/topics/email/#sending-alternative-content-types
Release note needs to be added for 5.2
As it's something that could be added later, I don't think it needs to be discussed now 🤔 can see when other people review also |
|
Hi @sarahboyce! Another noobie question 😅 One check is failing but I can't see how I can fix the issue.
complains about
Any ideas on that? Thx! |
Yes thank you ✅
I think you've done a good job with the docs that are available. On the failing check, a couple of the test runs have been failing recently on many PRs and I'm not sure why. It's unrelated to your PR 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lovely, looking good 👍 some more thoughts on the docs
The Jenkins workspace for this job was corrupted, I have wiped it so future runs should pass OK. |
Note: merged in #18261 which caused a couple of docs conflicts but shouldn't require further updates |
@sarahboyce Solved the merge conflicts 👍 |
40a6efe
to
13e056b
Compare
13e056b
to
f7b4421
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you 👍 welcome onboard ⛵
Trac ticket number
ticket-35528
Branch description
Currently, it's very hard and tedious to assert the content of an email object. Therefore, we want to add a method "body_contains()" to "EmailMultiAlternatives" to check a search string in all available text-based alternatives (content parts, like HTML).
This method can then be easily asserted in any given unit-test.
There's a forum discussion going on about this topic: https://forum.djangoproject.com/t/improve-email-unit-testing/32044/1
I've already created a PR for a suggetion: https://github.com/django/django/pull/18278/files
Checklist
main
branch.