[Django] #35528: Added "body_contains" method to "EmailMultiAlternatives"

4 views
Skip to first unread message

Django

unread,
Jun 17, 2024, 11:10:20 AM6/17/24
to django-...@googlegroups.com
#35528: Added "body_contains" method to "EmailMultiAlternatives"
---------------------------------------+------------------------
Reporter: Ron | Owner: nobody
Type: New feature | Status: new
Component: Core (Mail) | Version: dev
Severity: Normal | Keywords: email
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------+------------------------
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
--
Ticket URL: <https://code.djangoproject.com/ticket/35528>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Reply all
Reply to author
Forward
0 new messages