diff options
| author | Barry Warsaw | 2017-05-25 15:35:46 +0000 |
|---|---|---|
| committer | Barry Warsaw | 2017-05-25 15:35:46 +0000 |
| commit | 792f1eb7d511b3b4ec8564c9fcbfc87acd0de9a4 (patch) | |
| tree | 2fd725257bdf566e96a27f2c95d6d4942c0ec3f8 /src/mailman/chains/tests/test_headers.py | |
| parent | 3596e9f971e289270ec372266cd0d891b61b56e6 (diff) | |
| parent | 3df8d5182b44148bbd4b43f5474cd67b2ca699f9 (diff) | |
| download | mailman-792f1eb7d511b3b4ec8564c9fcbfc87acd0de9a4.tar.gz mailman-792f1eb7d511b3b4ec8564c9fcbfc87acd0de9a4.tar.zst mailman-792f1eb7d511b3b4ec8564c9fcbfc87acd0de9a4.zip | |
Diffstat (limited to 'src/mailman/chains/tests/test_headers.py')
| -rw-r--r-- | src/mailman/chains/tests/test_headers.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/mailman/chains/tests/test_headers.py b/src/mailman/chains/tests/test_headers.py index 3da7a2435..cd4c932cc 100644 --- a/src/mailman/chains/tests/test_headers.py +++ b/src/mailman/chains/tests/test_headers.py @@ -19,7 +19,7 @@ import unittest -from email.header import Header +from email import message_from_bytes from mailman.app.lifecycle import create_list from mailman.chains.headers import HeaderMatchRule, make_link from mailman.config import config @@ -212,23 +212,18 @@ This is junk def test_get_all_returns_non_string(self): # Test case where msg.get_all() returns header instance. - msg = mfs("""\ + msg = message_from_bytes(b"""\ From: anne@example.com To: test@example.com -Subject: =?unknown-8bit?q?Become_smarter_now_=96_Increase__your_brain...?= +Subject: Bad \x96 subject Message-ID: <ant> body -""") - # XXX In the wild we have seen a message instance in which the subject - # header value is an email.header.Header instance rather than a - # string. We don't know how to recreate that here so we cheat. - msg['Subject'] = Header( - 'Become_smarter_now \x96 Increase your brain...', 'utf-8') +""", Message) msgdata = {} header_matches = IHeaderMatchList(self._mlist) - header_matches.append('Subject', '=\?utf', 'hold') + header_matches.append('Subject', 'Bad', 'hold') # This event subscriber records the event that occurs when the message # is processed by the owner chain. events = [] |
