diff options
Diffstat (limited to 'src')
| -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 = [] |
