forked from pool/python
21 lines
800 B
Diff
21 lines
800 B
Diff
|
---
|
||
|
Lib/email/test/test_email.py | 7 +++++++
|
||
|
1 file changed, 7 insertions(+)
|
||
|
|
||
|
--- a/Lib/email/test/test_email.py
|
||
|
+++ b/Lib/email/test/test_email.py
|
||
|
@@ -2502,6 +2502,13 @@ Foo
|
||
|
# Test Utils.supports_strict_parsing attribute
|
||
|
self.assertEqual(Utils.supports_strict_parsing, True)
|
||
|
|
||
|
+ def test_parsing_unicode_str(self):
|
||
|
+ email_in = "Honza Novák <honza@example.com>"
|
||
|
+ self.assertEqual(Utils.parseaddr(email_in),
|
||
|
+ ('Honza Nov\xc3\xa1k', 'honza@example.com'))
|
||
|
+ self.assertEqual(Utils.parseaddr(email_in.decode('utf-8')),
|
||
|
+ ('Honza Nov\xc3\xa1k', 'honza@example.com'))
|
||
|
+
|
||
|
def test_getaddresses_nasty(self):
|
||
|
for addresses, expected in (
|
||
|
([u'"Sürname, Firstname" <to@example.com>'],
|