summaryrefslogtreecommitdiff
path: root/src/mailman/handlers/tests
diff options
context:
space:
mode:
authorBarry Warsaw2016-07-16 15:44:07 -0400
committerBarry Warsaw2016-07-16 15:44:07 -0400
commitdbde6231ec897379ed38ed4cd015b8ab20ed5fa1 (patch)
tree1226d06a238314262a1d04d0bbf9c4dc0b72c309 /src/mailman/handlers/tests
parent3387791beb7112dbe07664041f117fdcc20df53d (diff)
downloadmailman-dbde6231ec897379ed38ed4cd015b8ab20ed5fa1.tar.gz
mailman-dbde6231ec897379ed38ed4cd015b8ab20ed5fa1.tar.zst
mailman-dbde6231ec897379ed38ed4cd015b8ab20ed5fa1.zip
Diffstat (limited to 'src/mailman/handlers/tests')
-rw-r--r--src/mailman/handlers/tests/test_decorate.py16
-rw-r--r--src/mailman/handlers/tests/test_rfc_2369.py7
2 files changed, 15 insertions, 8 deletions
diff --git a/src/mailman/handlers/tests/test_decorate.py b/src/mailman/handlers/tests/test_decorate.py
index 7d44214cb..2187a908b 100644
--- a/src/mailman/handlers/tests/test_decorate.py
+++ b/src/mailman/handlers/tests/test_decorate.py
@@ -24,10 +24,12 @@ from mailman.app.lifecycle import create_list
from mailman.config import config
from mailman.handlers import decorate
from mailman.interfaces.archiver import IArchiver
+from mailman.interfaces.template import ITemplateManager
from mailman.testing.helpers import (
LogFileMark, specialized_message_from_string as mfs)
from mailman.testing.layers import ConfigLayer
from tempfile import TemporaryDirectory
+from zope.component import getUtility
from zope.interface import implementer
@@ -86,7 +88,8 @@ This is a test message.
footer_path = os.path.join(site_dir, 'myfooter.txt')
with open(footer_path, 'w', encoding='utf-8') as fp:
print('${testarchiver_url}', file=fp)
- self._mlist.footer_uri = 'mailman:///myfooter.txt'
+ getUtility(ITemplateManager).set(
+ 'list:member:regular:footer', None, 'mailman:///myfooter.txt')
self._mlist.preferred_language = 'en'
decorate.process(self._mlist, self._msg, {})
self.assertIn('http://example.com/link_to_message',
@@ -100,7 +103,9 @@ This is a test message.
footer_path = os.path.join(list_dir, 'myfooter.txt')
with open(footer_path, 'w', encoding='utf-8') as fp:
print('${testarchiver_url}', file=fp)
- self._mlist.footer_uri = 'mailman:///${list_id}/myfooter.txt'
+ getUtility(ITemplateManager).set(
+ 'list:member:regular:footer', self._mlist.list_id,
+ 'mailman:///${list_id}/myfooter.txt')
self._mlist.preferred_language = 'en'
decorate.process(self._mlist, self._msg, {})
self.assertIn('http://example.com/link_to_message',
@@ -114,7 +119,8 @@ This is a test message.
footer_path = os.path.join(list_dir, 'myfooter.txt')
with open(footer_path, 'w', encoding='utf-8') as fp:
print('${testarchiver_url}', file=fp)
- self._mlist.footer_uri = (
+ getUtility(ITemplateManager).set(
+ 'list:member:regular:footer', self._mlist.list_id,
'mailman:///${list_id}/${language}/myfooter.txt')
self._mlist.preferred_language = 'it'
decorate.process(self._mlist, self._msg, {})
@@ -155,7 +161,9 @@ This is a test message.
footer_path = os.path.join(site_dir, 'myfooter.txt')
with open(footer_path, 'w', encoding='utf-8') as fp:
print('${broken_url}', file=fp)
- self._mlist.footer_uri = 'mailman:///myfooter.txt'
+ getUtility(ITemplateManager).set(
+ 'list:member:regular:footer', self._mlist.list_id,
+ 'mailman:///myfooter.txt')
self._mlist.preferred_language = 'en'
mark = LogFileMark('mailman.archiver')
decorate.process(self._mlist, self._msg, {})
diff --git a/src/mailman/handlers/tests/test_rfc_2369.py b/src/mailman/handlers/tests/test_rfc_2369.py
index e78cf9c47..41b94ae0f 100644
--- a/src/mailman/handlers/tests/test_rfc_2369.py
+++ b/src/mailman/handlers/tests/test_rfc_2369.py
@@ -37,7 +37,7 @@ class DummyArchiver:
def list_url(self, mlist):
"""See `IArchiver`."""
- return mlist.domain.base_url
+ return 'http://{}'.format(mlist.mail_host)
def permalink(self, mlist, msg):
"""See `IArchiver`."""
@@ -105,11 +105,10 @@ Dummy text
self.addCleanup(config.pop, 'archiver')
rfc_2369.process(self._mlist, self._msg, {})
self.assertEqual(
- self._msg.get_all('List-Archive'),
- ['<http://lists.example.com>'])
+ self._msg.get_all('List-Archive'), ['<http://example.com>'])
self.assertEqual(
self._msg.get_all('Archived-At'),
- ['<http://lists.example.com/4CMWUN6BHVCMHMDAOSJZ2Q72G5M32MWB>'])
+ ['<http://example.com/4CMWUN6BHVCMHMDAOSJZ2Q72G5M32MWB>'])
def test_prototype_no_url(self):
# The prototype archiver is not web-based, it must not return URLs