summaryrefslogtreecommitdiff
path: root/tests/regressiontests
diff options
context:
space:
mode:
authorLuke Plant <L.Plant.98@cantab.net>2010-10-07 23:36:02 +0000
committerLuke Plant <L.Plant.98@cantab.net>2010-10-07 23:36:02 +0000
commit0aa438a3dff24a4e257a1190d2ba32893dfbc54d (patch)
tree4de23b42a874fc10f462cc6ff6d2feca1d1ef53b /tests/regressiontests
parent2faa490aeb142345daf7d75a40b8c73e1099f6d8 (diff)
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
Diffstat (limited to 'tests/regressiontests')
-rw-r--r--tests/regressiontests/mail/tests.py26
1 files changed, 26 insertions, 0 deletions
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'
+
"""