summaryrefslogtreecommitdiff
path: root/src/mailman/handlers/tests/test_mimedel.py
diff options
context:
space:
mode:
authorBarry Warsaw2017-05-23 23:54:59 +0000
committerBarry Warsaw2017-05-23 23:54:59 +0000
commit6894855b2b6c6fb7ada2dca3708f67a16cf2e2da (patch)
tree2e3b49f71477d5ccdfc23450e6a99caf980db78a /src/mailman/handlers/tests/test_mimedel.py
parent0eb24746c61a5fd944adb2b82681e4df6a039de1 (diff)
parent773e6e3c60d577a8526fc75908ee446d6a6da0ac (diff)
downloadmailman-6894855b2b6c6fb7ada2dca3708f67a16cf2e2da.tar.gz
mailman-6894855b2b6c6fb7ada2dca3708f67a16cf2e2da.tar.zst
mailman-6894855b2b6c6fb7ada2dca3708f67a16cf2e2da.zip
Diffstat (limited to 'src/mailman/handlers/tests/test_mimedel.py')
-rw-r--r--src/mailman/handlers/tests/test_mimedel.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mailman/handlers/tests/test_mimedel.py b/src/mailman/handlers/tests/test_mimedel.py
index 01cac0f20..3a50852da 100644
--- a/src/mailman/handlers/tests/test_mimedel.py
+++ b/src/mailman/handlers/tests/test_mimedel.py
@@ -38,6 +38,7 @@ from mailman.testing.helpers import (
specialized_message_from_string as mfs)
from mailman.testing.layers import ConfigLayer
from pkg_resources import resource_filename
+from unittest.mock import patch
from zope.component import getUtility
@@ -224,6 +225,7 @@ class TestMiscellaneous(unittest.TestCase):
"""Test various miscellaneous filtering actions."""
layer = ConfigLayer
+ maxDiff = None
def setUp(self):
self._mlist = create_list('test@example.com')
@@ -256,8 +258,13 @@ multipart/signed
with open(email_file) as fp:
msg = email.message_from_file(fp)
process = config.handlers['mime-delete'].process
- process(self._mlist, msg, {})
- with open(email_file2) as fp:
+ with ExitStack() as resources:
+ fp = resources.enter_context(open(email_file2))
+ # Mock this so that the X-Content-Filtered-By header isn't
+ # sensitive to Mailman version bumps.
+ resources.enter_context(
+ patch('mailman.handlers.mime_delete.VERSION', '123'))
+ process(self._mlist, msg, {})
self.assertEqual(msg.as_string(), fp.read())
def test_mixed_case_ext_and_recast(self):