<feed xmlns='http://www.w3.org/2005/Atom'>
<title>django.git/tests/mail/tests.py, branch main</title>
<subtitle>django
</subtitle>
<id>http://cgit.adnoto.dev/django.git/atom?h=main</id>
<link rel='self' href='http://cgit.adnoto.dev/django.git/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/'/>
<updated>2026-04-11T12:54:07Z</updated>
<entry>
<title>Fixed #36953 -- Split EmailBackend tests to separate file.</title>
<updated>2026-04-11T12:54:07Z</updated>
<author>
<name>Mike Edmunds</name>
<email>medmunds@gmail.com</email>
</author>
<published>2026-03-19T21:10:42Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=d61f33f03b3177afdf1d76153014bad4107b1224'/>
<id>urn:sha1:d61f33f03b3177afdf1d76153014bad4107b1224</id>
<content type='text'>
Moved tests for specific email backends from tests/mail/tests.py
to test_backends.py to reduce file size and discourage adding
non-backend-specific tests to BaseEmailBackendTests.
</content>
</entry>
<entry>
<title>Refs #36953 -- Moved non-backend-dependent BaseEmailBackendTests.</title>
<updated>2026-04-11T12:54:07Z</updated>
<author>
<name>Mike Edmunds</name>
<email>medmunds@gmail.com</email>
</author>
<published>2026-03-19T20:59:34Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=3ef48ca6c10830914b09abd20ef48a705e1fbfcd'/>
<id>urn:sha1:3ef48ca6c10830914b09abd20ef48a705e1fbfcd</id>
<content type='text'>
Relocated BaseEmailBackendTests that are _not_ dependent on the email
backend.

- In general, moved test cases to EmailMessageTests or SendMailTests
  as appropriate, and changed them to work with the testing outbox.

- Replaced BaseEmailBackendTests.test_send_verbose_name() with
  EmailMessageTests.test_unicode_display_name_in_from_email().
  (EmailMessageTests.test_address_header_handling() also partly covers
  the behavior, as well as Python's own message serialization tests.)

- Removed BaseEmailBackendTests.test_message_cc_header(), which was
  already covered by EmailMessageTests.test_cc*() (and Python's own
  message serialization tests).

- Replaced BaseEmailBackendTests.test_idn_send() with
  EmailMessageTests.test_idn_addresses() to cover from_email and cc.
  (EmailMessageTests.test_address_header_handling() already covered to.)

- Removed BaseEmailBackendTests.test_recipient_without_domain(), which
  was partly covered by EmailMessageTests.test_localpart_only_address().
  Updated the latter to cover a localpart-only from_email.

- Updated docstrings and comments to clarify a few tests that _do_
  depend on the email backend.
</content>
</entry>
<entry>
<title>Refs #36953 -- Split apart catchall MailTests.</title>
<updated>2026-04-11T12:54:07Z</updated>
<author>
<name>Mike Edmunds</name>
<email>medmunds@gmail.com</email>
</author>
<published>2026-03-19T18:22:57Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=a8ef1a697bbe7b74141cd74c26d15ed35dd7817f'/>
<id>urn:sha1:a8ef1a697bbe7b74141cd74c26d15ed35dd7817f</id>
<content type='text'>
Replaced large MailTests class with smaller classes focused on
specific django.core.mail APIs:

- EmailMessageTests: covering EmailMessage and EmailMultiAlternatives
  classes (the bulk of the former MailTests cases).
- SendMailTests, SendMassMailTests, MailAdminsAndManagersTests:
  covering the function-based mail APIs.
- GetConnectionTests: covering get_connection().
- DeprecatedInternalsTests: covering deprecated internal methods used
  in deprecated functionality.
- DummyBackendTests: covering the dummy EmailBackend.

In the process, moved the two cases from MailTimeZoneTests into the new
EmailMessageTests, as they related to EmailMessage Date headers.
</content>
</entry>
<entry>
<title>Refs #36953 -- Split compound mail tests.</title>
<updated>2026-04-11T12:54:07Z</updated>
<author>
<name>Mike Edmunds</name>
<email>medmunds@gmail.com</email>
</author>
<published>2026-03-18T20:13:24Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=36ccdcc511e8ca5dc20e881fb9a3a310a8f85871'/>
<id>urn:sha1:36ccdcc511e8ca5dc20e881fb9a3a310a8f85871</id>
<content type='text'>
Broke apart independent cases in mail tests using subTest() or separate
methods.
</content>
</entry>
<entry>
<title>Refs #36953 -- Removed unnecessary overrides from mail tests.</title>
<updated>2026-04-11T12:54:07Z</updated>
<author>
<name>Mike Edmunds</name>
<email>medmunds@gmail.com</email>
</author>
<published>2026-03-15T23:20:38Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=60f07e81c5cc31c8897173567915fd1a6482d180'/>
<id>urn:sha1:60f07e81c5cc31c8897173567915fd1a6482d180</id>
<content type='text'>
Django automatically substitutes the locmem EmailBackend during tests,
and SimpleTestCase empties mail.outbox before each test.
</content>
</entry>
<entry>
<title>Fixed #36894 -- Added TypeError for conflicting arguments in mail APIs.</title>
<updated>2026-03-16T16:51:58Z</updated>
<author>
<name>Praful Gulani</name>
<email>prafulgulani555@gmail.com</email>
</author>
<published>2026-02-12T14:33:25Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=2333d56696141303000986a16553205ece993c67'/>
<id>urn:sha1:2333d56696141303000986a16553205ece993c67</id>
<content type='text'>
A TypeError is now raised if fail_silently=True, auth_user, or auth_password
are provided along a connection.

Updated AdminEmailHandler in django.utils.log to remove redundant
fail_silently=True.

Thanks Mike Edmunds for the report and Jacob Tyler Walls for the review.
</content>
</entry>
<entry>
<title>Applied Black's 2026 stable style.</title>
<updated>2026-01-18T20:26:56Z</updated>
<author>
<name>Mariusz Felisiak</name>
<email>felisiak.mariusz@gmail.com</email>
</author>
<published>2026-01-18T20:26:56Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=6cff02078799b7c683a0d39630d49ab4fe532e7c'/>
<id>urn:sha1:6cff02078799b7c683a0d39630d49ab4fe532e7c</id>
<content type='text'>
https://github.com/psf/black/releases/tag/26.1.0</content>
</entry>
<entry>
<title>Refs #35844 -- Doc'd Python 3.14 compatibility.</title>
<updated>2025-10-17T17:25:02Z</updated>
<author>
<name>Mariusz Felisiak</name>
<email>felisiak.mariusz@gmail.com</email>
</author>
<published>2025-10-13T14:34:26Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=56977b466c33ca3da14a1ed2609172425a76a34e'/>
<id>urn:sha1:56977b466c33ca3da14a1ed2609172425a76a34e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fixed #35581 -- Updated django.core.mail to Python's modern email API.</title>
<updated>2025-07-25T11:50:02Z</updated>
<author>
<name>Mike Edmunds</name>
<email>medmunds@gmail.com</email>
</author>
<published>2024-12-23T23:01:36Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=9ab1991689000821a4d86b8617e1c1455a327482'/>
<id>urn:sha1:9ab1991689000821a4d86b8617e1c1455a327482</id>
<content type='text'>
- Changed EmailMessage.message() to construct a "modern email API"
  email.message.EmailMessage and added policy keyword arg.
- Added support for modern MIMEPart objects in EmailMessage.attach()
  (and EmailMessage constructor, EmailMessage.attachments list).
- Updated SMTP EmailBackend to use modern email.policy.SMTP.

Deprecated:
- Attaching MIMEBase objects (replace with MIMEPart)
- BadHeaderError (modern email uses ValueError)
- SafeMIMEText, SafeMIMEMultipart (unnecessary for modern email)
- django.core.mail.forbid_multi_line_headers()
  (undocumented, but exposed via `__all__` and in wide use)
- django.core.mail.message.sanitize_address()
  (undocumented, but in wide use)

Removed without deprecation (all undocumented):
- EmailMessage.mixed_subtype
- EmailMultiAlternatives.alternative_subtype
- Support for setting (undocumented) EmailMessage.encoding property
  to a legacy email.charset.Charset object

Related changes:
- Dropped tests for incorrect RFC 2047 encoding of non-ASCII email
  address localparts. This is specifically prohibited by RFC 2047, and
  not supported by any known MTA or email client. (Python still
  mis-applies encoded-word to non-ASCII localparts, but it is a bug that
  may be fixed in the future.)
- Added tests that try to discourage using Python's legacy email APIs
  in future updates to django.core.mail.
</content>
</entry>
<entry>
<title>Refs #35581 -- Added missing test for lazy email headers.</title>
<updated>2025-07-25T11:50:02Z</updated>
<author>
<name>Mike Edmunds</name>
<email>medmunds@gmail.com</email>
</author>
<published>2025-07-20T00:33:09Z</published>
<link rel='alternate' type='text/html' href='http://cgit.adnoto.dev/django.git/commit/?id=20c62199ffe0de1410083657a6d5bac799592210'/>
<id>urn:sha1:20c62199ffe0de1410083657a6d5bac799592210</id>
<content type='text'>
EmailMessage is intended to support lazy strings in any header field
(via coercion to `str` in forbid_multi_line_headers() called from
SafeMIMEMessage/Text/Multipart.__setitem__).
</content>
</entry>
</feed>
