Opened 5 months ago
Closed 5 months ago
#35528 closed New feature (fixed)
Add EmailMultiAlternatives.body_contains() to aid email test assertions
Reported by: | Ronny Vedrilla | Owned by: | Ronny Vedrilla |
---|---|---|---|
Component: | Core (Mail) | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
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
Change History (6)
comment:1 by , 5 months ago
Has patch: | set |
---|---|
Summary: | Added "body_contains" method to "EmailMultiAlternatives" → Add EmailMultiAlternatives.body_contains() to aid email test assertions |
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 5 months ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 5 months ago
Patch needs improvement: | set |
---|
comment:4 by , 5 months ago
Patch needs improvement: | unset |
---|
comment:5 by , 5 months ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:6 by , 5 months ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
In 5fef6d2: