summaryrefslogtreecommitdiff
path: root/tests/regressiontests/mail/tests.py
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-07-26 03:37:25 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-07-26 03:37:25 +0000
commitf49c5c23f96f11a993036fa10c81b4287327d7ec (patch)
tree386354819d33b49e0dd6796bb3803d29b8a08b8d /tests/regressiontests/mail/tests.py
parentb149e3d9e7fce426e0ee5db5e7f1988b9f2d147c (diff)
Fixed #7574 -- Fixed the handling of lazy translation in email headers.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8083 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/mail/tests.py')
-rw-r--r--tests/regressiontests/mail/tests.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/regressiontests/mail/tests.py b/tests/regressiontests/mail/tests.py
index 9d2e2abe96..be59234342 100644
--- a/tests/regressiontests/mail/tests.py
+++ b/tests/regressiontests/mail/tests.py
@@ -3,6 +3,7 @@ r"""
# Tests for the django.core.mail.
>>> from django.core.mail import EmailMessage
+>>> from django.utils.translation import ugettext_lazy
# Test normal ascii character case:
@@ -36,6 +37,12 @@ r"""
>>> message = email.message()
Traceback (most recent call last):
...
-BadHeaderError: Header values can't contain newlines (got 'Subject\nInjection Test' for header 'Subject')
+BadHeaderError: Header values can't contain newlines (got u'Subject\nInjection Test' for header 'Subject')
+
+>>> email = EmailMessage(ugettext_lazy('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 u'Subject\nInjection Test' for header 'Subject')
"""