summaryrefslogtreecommitdiff
path: root/tests/regressiontests/mail
diff options
context:
space:
mode:
authorJustin Bronn <jbronn@gmail.com>2008-07-19 13:30:47 +0000
committerJustin Bronn <jbronn@gmail.com>2008-07-19 13:30:47 +0000
commit149e731c3c5a2cc96b7d3c72070401df6c2a238e (patch)
tree2a819f695246ab36139b7f8846085c9df1563bd8 /tests/regressiontests/mail
parent5bf3565a263533e37b2e1217e8d447cb7e02f5b4 (diff)
gis: Merged revisions 7921,7926-7928,7938-7941,7945-7947,7949-7950,7952,7955-7956,7961,7964-7968,7970-7978 via svnmerge from trunk.
This includes the newforms-admin branch, and thus is backwards-incompatible. The geographic admin is _not_ in this changeset, and is forthcoming. git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@7979 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/mail')
-rw-r--r--tests/regressiontests/mail/__init__.py2
-rw-r--r--tests/regressiontests/mail/models.py1
-rw-r--r--tests/regressiontests/mail/tests.py41
3 files changed, 44 insertions, 0 deletions
diff --git a/tests/regressiontests/mail/__init__.py b/tests/regressiontests/mail/__init__.py
new file mode 100644
index 0000000000..139597f9cb
--- /dev/null
+++ b/tests/regressiontests/mail/__init__.py
@@ -0,0 +1,2 @@
+
+
diff --git a/tests/regressiontests/mail/models.py b/tests/regressiontests/mail/models.py
new file mode 100644
index 0000000000..7ff128fa69
--- /dev/null
+++ b/tests/regressiontests/mail/models.py
@@ -0,0 +1 @@
+# This file intentionally left blank \ No newline at end of file
diff --git a/tests/regressiontests/mail/tests.py b/tests/regressiontests/mail/tests.py
new file mode 100644
index 0000000000..9d2e2abe96
--- /dev/null
+++ b/tests/regressiontests/mail/tests.py
@@ -0,0 +1,41 @@
+# coding: utf-8
+r"""
+# Tests for the django.core.mail.
+
+>>> from django.core.mail import EmailMessage
+
+# Test normal ascii character case:
+
+>>> email = EmailMessage('Subject', 'Content', 'from@example.com', ['to@example.com'])
+>>> message = email.message()
+>>> message['Subject']
+'Subject'
+>>> message.get_payload()
+'Content'
+>>> message['From']
+'from@example.com'
+>>> message['To']
+'to@example.com'
+
+# Test multiple-recipient case
+
+>>> email = EmailMessage('Subject', 'Content', 'from@example.com', ['to@example.com','other@example.com'])
+>>> message = email.message()
+>>> message['Subject']
+'Subject'
+>>> message.get_payload()
+'Content'
+>>> message['From']
+'from@example.com'
+>>> message['To']
+'to@example.com, other@example.com'
+
+# Test for header injection
+
+>>> email = EmailMessage('Subject\nInjection Test', 'Content', 'from@example.com', ['to@example.com'])
+>>> message = email.message()
+Traceback (most recent call last):
+ ...
+BadHeaderError: Header values can't contain newlines (got 'Subject\nInjection Test' for header 'Subject')
+
+"""