diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-10-07 12:26:00 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2008-10-07 12:26:00 +0000 |
| commit | b3c2cf3d1d7f800a2b4f4763ceb763c9e1b7f13c (patch) | |
| tree | 779745e3ce4745017cb95c5020b377bc1fe87776 /tests | |
| parent | 742ff0800b57cf0657af3a6d85435cd84d2f8334 (diff) | |
[1.0.X] Fixed #9233 -- Allow date and message-id headers to be passed in
manually in email messages. Previously we were creating duplicate headers,
which was bad.
Backport of r9197 from trunk. I'm calling this a bugfix, since the docs are
unclear about which headers you can pass into an EmailMessage constructor.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9198 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/mail/tests.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/regressiontests/mail/tests.py b/tests/regressiontests/mail/tests.py index c8b85f48c6..c2c084c4c6 100644 --- a/tests/regressiontests/mail/tests.py +++ b/tests/regressiontests/mail/tests.py @@ -52,4 +52,12 @@ BadHeaderError: Header values can't contain newlines (got u'Subject\nInjection T >>> message.as_string() 'Content-Type: text/plain; charset="utf-8"\nMIME-Version: 1.0\nContent-Transfer-Encoding: quoted-printable\nSubject: Long subject lines that get wrapped should use a space continuation\n character to get expected behaviour in Outlook and Thunderbird\nFrom: from@example.com\nTo: to@example.com\nDate: ...\nMessage-ID: <...>\n\nContent' +# Specifying dates or message-ids in the extra headers overrides the defaul +# values (#9233). + +>>> headers = {"date": "Fri, 09 Nov 2001 01:08:47 -0000", "Message-ID": "foo"} +>>> email = EmailMessage('subject', 'content', 'from@example.com', ['to@example.com'], headers=headers) +>>> email.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\ndate: Fri, 09 Nov 2001 01:08:47 -0000\nMessage-ID: foo\n\ncontent' + """ |
