From 3929c688da2b275a1bb965152cca8a7352557ffc Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Sun, 6 Jul 2008 10:27:05 -0400 Subject: Use IMailingList.posting_address (a.k.a. List-Post header) in the Mail-Archive.com hash calculation, not the post-id sequence number. test_documentation now starts and stops the smtp listener, simplifing many tests. --- mailman/tests/test_documentation.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'mailman/tests/test_documentation.py') diff --git a/mailman/tests/test_documentation.py b/mailman/tests/test_documentation.py index 48c2c491c..2d42f989d 100644 --- a/mailman/tests/test_documentation.py +++ b/mailman/tests/test_documentation.py @@ -29,6 +29,7 @@ import mailman from mailman.Message import Message from mailman.app.styles import style_manager from mailman.configuration import config +from mailman.testing.helpers import SMTPServer DOT = '.' @@ -54,12 +55,15 @@ def specialized_message_from_string(text): def setup(testobj): """Test setup.""" + smtpd = SMTPServer() + smtpd.start() # In general, I don't like adding convenience functions, since I think # doctests should do the imports themselves. It makes for better # documentation that way. However, a few are really useful, or help to # hide some icky test implementation details. testobj.globs['message_from_string'] = specialized_message_from_string testobj.globs['commit'] = config.db.commit + testobj.globs['smtpd'] = smtpd @@ -82,6 +86,10 @@ def cleaning_teardown(testobj): # Reset all archivers by disabling them. for archiver in config.archivers.values(): archiver.is_enabled = False + # Shutdown the smtp server. + smtpd = testobj.globs['smtpd'] + smtpd.clear() + smtpd.stop() -- cgit v1.2.3-70-g09d2