test_escape_backslashes(): A test for SF bug #663369 by Matthew Woodcraft.

This commit is contained in:
Barry Warsaw 2003-03-10 19:18:34 +00:00
parent 59e98ae1c5
commit a2e64702ca
1 changed files with 8 additions and 0 deletions

View File

@ -1859,6 +1859,14 @@ class TestMiscellaneous(unittest.TestCase):
b = 'person@dom.ain'
self.assertEqual(Utils.parseaddr(Utils.formataddr((a, b))), (a, b))
def test_escape_backslashes(self):
self.assertEqual(
Utils.formataddr(('Arthur \Backslash\ Foobar', 'person@dom.ain')),
r'"Arthur \\Backslash\\ Foobar" <person@dom.ain>')
a = r'Arthur \Backslash\ Foobar'
b = 'person@dom.ain'
self.assertEqual(Utils.parseaddr(Utils.formataddr((a, b))), (a, b))
def test_name_with_dot(self):
x = 'John X. Doe <jxd@example.com>'
y = '"John X. Doe" <jxd@example.com>'