From 211a82ddb463ac044ba20d51208e5f5a169dcb6c Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Sat, 20 Sep 2008 00:33:07 -0400 Subject: Support for proper domains by interface. Add a test and update modules as necessary. Finally delete DEFAULT_EMAIL_HOST and DEFAULT_URL_HOST. Now add_domain() must be called in the confirmation file for every domain. add_domain() itself is now pretty much just a proxy for the Domain constructor. Add stop() as an alias for pdb.set_trace() to the documentation doctest globs. --- mailman/tests/test_documentation.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'mailman/tests/test_documentation.py') diff --git a/mailman/tests/test_documentation.py b/mailman/tests/test_documentation.py index 2d42f989d..13ffd8cbf 100644 --- a/mailman/tests/test_documentation.py +++ b/mailman/tests/test_documentation.py @@ -53,6 +53,14 @@ def specialized_message_from_string(text): return message +def stop(): + """Call into pdb.set_trace()""" + # Do the import here so that you get the wacky special hacked pdb instead + # of Python's normal pdb. + import pdb + pdb.set_trace() + + def setup(testobj): """Test setup.""" smtpd = SMTPServer() @@ -64,6 +72,10 @@ def setup(testobj): testobj.globs['message_from_string'] = specialized_message_from_string testobj.globs['commit'] = config.db.commit testobj.globs['smtpd'] = smtpd + testobj.globs['stop'] = stop + # Stash the current state of the global domains away for restoration in + # the teardown. + testobj._domains = config.domains.copy() @@ -71,6 +83,8 @@ def cleaning_teardown(testobj): """Clear all persistent data at the end of a doctest.""" # Clear the database of all rows. config.db._reset() + # Reset the global domains. + config.domains = testobj._domains # Remove all but the default style. for style in style_manager.styles: if style.name <> 'default': -- cgit v1.2.3-70-g09d2