1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #28912 -- Made EmailMessage.message() omit an empty To header.

This commit is contained in:
Jon Dufresne
2017-12-08 19:28:34 -08:00
committed by Tim Graham
parent b03d500295
commit da82939e5a
2 changed files with 6 additions and 2 deletions

View File

@@ -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