diff --git a/tests/regressiontests/mail/tests.py b/tests/regressiontests/mail/tests.py index ffb86dbeac7..d68855e232b 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)