diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2017-12-08 19:28:34 -0800 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-12-30 09:38:03 -0500 |
| commit | da82939e5a31dea21a4f4d5085dfcd449fcbed3a (patch) | |
| tree | 5538ef29bb052cf2bde9b0966941d1629e08052f /tests/mail | |
| parent | b03d5002955256c4b3ed7cfae5150eb79c0eb97e (diff) | |
| download | django-da82939e5a31dea21a4f4d5085dfcd449fcbed3a.tar.gz | |
Fixed #28912 -- Made EmailMessage.message() omit an empty To header.
Diffstat (limited to 'tests/mail')
| -rw-r--r-- | tests/mail/tests.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/mail/tests.py b/tests/mail/tests.py index c7b8d09027..68a15311dc 100644 --- a/tests/mail/tests.py +++ b/tests/mail/tests.py @@ -85,6 +85,10 @@ class MailTests(HeadersCheckMixin, SimpleTestCase): self.assertEqual(message['From'], 'from@example.com') self.assertEqual(message['To'], 'to@example.com, other@example.com') + def test_header_omitted_for_no_to_recipients(self): + message = EmailMessage('Subject', 'Content', 'from@example.com', cc=['cc@example.com']).message() + self.assertNotIn('To', message) + def test_recipients_with_empty_strings(self): """ Empty strings in various recipient arguments are always stripped |
