summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRamiro Morales <cramm0@gmail.com>2011-02-28 02:56:02 +0000
committerRamiro Morales <cramm0@gmail.com>2011-02-28 02:56:02 +0000
commitf5c0328fd3f5a965bace09f7aef0ada67751fad5 (patch)
treeba646eef5872120345c2f401467d85f8f560eb4a /tests
parent076ce17f0e7155cb7a0c8d6b863dbc430098187c (diff)
[1.2.X] Fixed #13433 -- Changed default behavior of Django email message wrappers to not mangle lines starting with 'From '. Thanks Leo for the report and patch.
Backport of [15669] from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@15670 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/mail/tests.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/regressiontests/mail/tests.py b/tests/regressiontests/mail/tests.py
index d77d0baeab..062eb3220f 100644
--- a/tests/regressiontests/mail/tests.py
+++ b/tests/regressiontests/mail/tests.py
@@ -11,8 +11,8 @@ import threading
from django.conf import settings
from django.core import mail
-from django.core.mail import EmailMessage, mail_admins, mail_managers, EmailMultiAlternatives
-from django.core.mail import send_mail, send_mass_mail
+from django.core.mail import (EmailMessage, mail_admins, mail_managers,
+ EmailMultiAlternatives, send_mail, send_mass_mail)
from django.core.mail.backends import console, dummy, locmem, filebased, smtp
from django.core.mail.message import BadHeaderError
from django.test import TestCase
@@ -263,6 +263,12 @@ class MailTests(TestCase):
self.assertEqual(len(connection.test_outbox), 1)
self.assertEqual(connection.test_outbox[0].subject, '[Django] Manager message')
+ def test_dont_mangle_from_in_body(self):
+ # Regression for #13433 - Make sure that EmailMessage doesn't mangle
+ # 'From ' in message body.
+ email = EmailMessage('Subject', 'From the future', 'bounce@example.com', ['to@example.com'], headers={'From': 'from@example.com'})
+ self.assertFalse('>From the future' in email.message().as_string())
+
class BaseEmailBackendTests(object):
email_backend = None