From 0aa438a3dff24a4e257a1190d2ba32893dfbc54d Mon Sep 17 00:00:00 2001 From: Luke Plant Date: Thu, 7 Oct 2010 23:36:02 +0000 Subject: Fixed #7722 - added support for CC in EmailMessage. Thanks to roberto.digirolamo for the report and initial patch, and dougvanhorn and SmileyChris for further work on the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14000 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/mail/tests.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'tests') diff --git a/tests/regressiontests/mail/tests.py b/tests/regressiontests/mail/tests.py index 84be585bfd..05973e608c 100644 --- a/tests/regressiontests/mail/tests.py +++ b/tests/regressiontests/mail/tests.py @@ -417,4 +417,30 @@ Content >>> settings.ADMINS = old_admins >>> settings.MANAGERS = old_managers +# Add Cc to the email argument list (#7722) + +>>> email = EmailMessage('Subject', 'Content', 'from@example.com', ['to@example.com'], cc=['cc@example.com']) +>>> message = email.message() +>>> message['Cc'] +'cc@example.com' +>>> email.recipients() +['to@example.com', 'cc@example.com'] + +>>> email = EmailMessage('Subject', 'Content', 'from@example.com', ['to@example.com','other@example.com'], cc=['cc@example.com', 'cc.other@example.com']) +>>> message = email.message() +>>> message['Cc'] +'cc@example.com, cc.other@example.com' +>>> email.recipients() +['to@example.com', 'other@example.com', 'cc@example.com', 'cc.other@example.com'] + +>>> 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() +>>> email.recipients() +['to@example.com', 'other@example.com', 'cc@example.com', 'cc.other@example.com', 'bcc@example.com'] + +>>> email = EmailMessage('Subject', 'Content', 'from@example.com', ['to@example.com'], cc=['cc@example.com']) +>>> message = email.message() +>>> message.as_string() +'Content-Type: text/plain; charset="utf-8"\nMIME-Version: 1.0\nContent-Transfer-Encoding: quoted-printable\nSubject: Subject\nFrom: from@example.com\nTo: to@example.com\nCc: cc@example.com\nDate: ...\nMessage-ID: <...>\n\nContent' + """ -- cgit v1.3