summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLucas Hoffmann <lucc@posteo.de>2018-10-11 00:59:34 +0200
committerPatrick Totzke <patricktotzke@gmail.com>2018-12-03 08:28:32 +0000
commitd5b3aab3ac12e0f627b03aedbbe14c8df0d709b2 (patch)
tree9fa320f2485634fdfaf072e03489ffc61d23f7d5 /tests
parentd120120d575a9d738182c1b6d788e0c92d2f3ac1 (diff)
Add simple test to demonstrate #1291
This does just call the final bit of code that throws the exception.
Diffstat (limited to 'tests')
-rw-r--r--tests/db/utils_test.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/db/utils_test.py b/tests/db/utils_test.py
index 6dd23a99..9fd49d76 100644
--- a/tests/db/utils_test.py
+++ b/tests/db/utils_test.py
@@ -730,3 +730,14 @@ class TestMessageFromString(unittest.TestCase):
m['To'] = 'Nobody'
message = utils.decrypted_message_from_string(m.as_string())
self.assertEqual(message.get_payload(), 'This is some text')
+
+
+class TestRemoveCte(unittest.TestCase):
+
+ @unittest.expectedFailure
+ def test_issue_1291(self):
+ with open('tests/static/mail/broken-utf8.eml') as fp:
+ mail = email.message_from_file(fp)
+ # This should not raise an UnicodeDecodeError.
+ utils.remove_cte(mail, as_string=True)
+ self.assertTrue(True)