Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #11928 -- Added test for tuple to list conversion during mail m…

…essage initialization added in r11709. Thanks, Claude Paroz.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16133 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 4b93bd8b3a29913fef56c1090738e03c6205a453 1 parent c78d861
@jezdez jezdez authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 tests/regressiontests/mail/tests.py
View
6 tests/regressiontests/mail/tests.py
@@ -93,6 +93,12 @@ def test_cc(self):
self.assertEqual(message['Cc'], 'cc@example.com, cc.other@example.com')
self.assertEqual(email.recipients(), ['to@example.com', 'other@example.com', 'cc@example.com', 'cc.other@example.com', 'bcc@example.com'])
+ def test_recipients_as_tuple(self):
+ email = EmailMessage('Subject', 'Content', 'from@example.com', ('to@example.com', 'other@example.com'), cc=('cc@example.com', 'cc.other@example.com'), bcc=('bcc@example.com',))
+ message = email.message()
+ self.assertEqual(message['Cc'], 'cc@example.com, cc.other@example.com')
+ self.assertEqual(email.recipients(), ['to@example.com', 'other@example.com', 'cc@example.com', 'cc.other@example.com', 'bcc@example.com'])
+
def test_header_injection(self):
email = EmailMessage('Subject\nInjection Test', 'Content', 'from@example.com', ['to@example.com'])
self.assertRaises(BadHeaderError, email.message)
Please sign in to comment.
Something went wrong with that request. Please try again.