summaryrefslogtreecommitdiff
path: root/tests/db
diff options
context:
space:
mode:
authorLucas Hoffmann <l-m-h@web.de>2017-06-30 11:00:38 +0200
committerLucas Hoffmann <l-m-h@web.de>2017-06-30 11:03:43 +0200
commit1e0595d39263d9f19d818c949d6e593e70303672 (patch)
treeb6f018efedbce3bf374dc06d7710a1ae270e7f9f /tests/db
parent1c7565783ac93f4e627ab8d3f7c14762c807c7e5 (diff)
Use stdlib functions in db.utils.encode_header
Instead of manual parsing with regexp and manual string formatting the functions from email.utils are used. This fixes some small inconsistencies with addresses with empty realnames and with commas in realnames.
Diffstat (limited to 'tests/db')
-rw-r--r--tests/db/utils_test.py2
1 files changed, 0 insertions, 2 deletions
diff --git a/tests/db/utils_test.py b/tests/db/utils_test.py
index 08e2d8a7..d07dd56a 100644
--- a/tests/db/utils_test.py
+++ b/tests/db/utils_test.py
@@ -176,7 +176,6 @@ class TestEncodeHeader(unittest.TestCase):
expected = email.header.Header(address)
self.assertEqual(actual, expected)
- @unittest.expectedFailure
def test_email_addresses_with_empty_realnames_are_treated_like_plain(self):
address = 'user@example.com'
empty_realname = '<'+address+'>'
@@ -203,7 +202,6 @@ class TestEncodeHeader(unittest.TestCase):
expected = email.header.Header(addresses)
self.assertEqual(actual, expected)
- @unittest.expectedFailure
def test_comma_in_names_are_allowed(self):
addresses = '"last, first" <guy@example.com>, ' \
'"name, other" <guy@example.com>'