From abd4344efe6bc9b138595a7d15998a0cbce5b9cf Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 4 Nov 2009 11:28:56 +0000 Subject: [1.1.X] Fixed #11144 -- When a to/from/cc header contains unicode, make sure the email addresses are parsed correctly (especially with regards to commas). Thanks to rmt for the patch. Backport of r11719 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@11720 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/mail/tests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/regressiontests/mail/tests.py b/tests/regressiontests/mail/tests.py index e90d77366f..ad9820866e 100644 --- a/tests/regressiontests/mail/tests.py +++ b/tests/regressiontests/mail/tests.py @@ -95,6 +95,17 @@ BadHeaderError: Header values can't contain newlines (got u'Subject\nInjection T >>> message['From'] 'from@example.com' +# Regression for #11144 - When a to/from/cc header contains unicode, +# make sure the email addresses are parsed correctly (especially +# with regards to commas) +>>> email = EmailMessage('Subject', 'Content', 'from@example.com', ['"Firstname Sürname" ','other@example.com']) +>>> email.message()['To'] +'=?utf-8?q?Firstname_S=C3=BCrname?= , other@example.com' + +>>> email = EmailMessage('Subject', 'Content', 'from@example.com', ['"Sürname, Firstname" ','other@example.com']) +>>> email.message()['To'] +'=?utf-8?q?S=C3=BCrname=2C_Firstname?= , other@example.com' + # Handle attachments within an multipart/alternative mail correctly (#9367) # (test is not as precise/clear as it could be w.r.t. email tree structure, # but it's good enough.) -- cgit v1.3