From 4b93bd8b3a29913fef56c1090738e03c6205a453 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Sat, 30 Apr 2011 14:00:15 +0000 Subject: [PATCH] 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 --- tests/regressiontests/mail/tests.py | 6 ++++++ 1 file changed, 6 insertions(+) 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)