summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJannis Leidel <jannis@leidel.info>2011-04-30 14:00:15 +0000
committerJannis Leidel <jannis@leidel.info>2011-04-30 14:00:15 +0000
commit4b93bd8b3a29913fef56c1090738e03c6205a453 (patch)
tree6af8c645d25191a2f1c61e2151c6db9f8bb49a2c
parentc78d861c244c953023ad8a128a0749d077b4e356 (diff)
Fixed #11928 -- Added test for tuple to list conversion during mail message initialization added in r11709. Thanks, Claude Paroz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16133 bcc190cf-cafb-0310-a4f2-bffc1f526a37
-rw-r--r--tests/regressiontests/mail/tests.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/regressiontests/mail/tests.py b/tests/regressiontests/mail/tests.py
index ffb86dbeac..d68855e232 100644
--- a/tests/regressiontests/mail/tests.py
+++ b/tests/regressiontests/mail/tests.py
@@ -93,6 +93,12 @@ class MailTests(TestCase):
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)