summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLucas Hoffmann <lucc@posteo.de>2018-12-24 11:06:59 +0100
committerPatrick Totzke <patricktotzke@gmail.com>2018-12-24 11:31:07 +0100
commit6bb18fa97c78b3cb1fcb60ce5d850602b55e358f (patch)
tree3ce26c87a30723487d37b87f01f93bac4785de58 /tests
parent9ff655ba0ef8db4abae5d5f3247ffd590c5b5ff6 (diff)
Add test case for new encoding problems
Diffstat (limited to 'tests')
-rw-r--r--tests/db/utils_test.py7
-rw-r--r--tests/static/mail/utf8.eml8
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/db/utils_test.py b/tests/db/utils_test.py
index 463d1075..7d54741f 100644
--- a/tests/db/utils_test.py
+++ b/tests/db/utils_test.py
@@ -711,6 +711,13 @@ class TestExtractBody(unittest.TestCase):
self.assertEqual(actual, expected)
+ @unittest.expectedFailure
+ def test_simple_utf8_file(self):
+ mail = email.message_from_binary_file(
+ open('tests/static/mail/utf8.eml', 'rb'))
+ actual = utils.extract_body(mail)
+ expected = "Liebe Grüße!\n"
+ self.assertEqual(actual, expected)
class TestMessageFromString(unittest.TestCase):
diff --git a/tests/static/mail/utf8.eml b/tests/static/mail/utf8.eml
new file mode 100644
index 00000000..fba63faf
--- /dev/null
+++ b/tests/static/mail/utf8.eml
@@ -0,0 +1,8 @@
+From: lucc@github
+To: tests@alot
+Subject: plain utf8 8bit message
+MIME-Version: 1.0
+Content-Type: text/plain; charset="UTF-8"
+Content-Transfer-Encoding: 8bit
+
+Liebe Grüße!