diff options
| author | Barry Warsaw | 2014-04-14 12:14:13 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2014-04-14 12:14:13 -0400 |
| commit | 403cbf23c07839b60c85c0bc791b6437f05c8a85 (patch) | |
| tree | b36d0ecab20e01f23bcf66ab2b27633aaf3e99c3 /src/mailman/testing/helpers.py | |
| parent | ff6df86000da8fcb055101c5cede36b27cb0480a (diff) | |
| parent | 3a9725b91ef822122a70170333d71b58e1788a78 (diff) | |
| download | mailman-403cbf23c07839b60c85c0bc791b6437f05c8a85.tar.gz mailman-403cbf23c07839b60c85c0bc791b6437f05c8a85.tar.zst mailman-403cbf23c07839b60c85c0bc791b6437f05c8a85.zip | |
Diffstat (limited to 'src/mailman/testing/helpers.py')
| -rw-r--r-- | src/mailman/testing/helpers.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mailman/testing/helpers.py b/src/mailman/testing/helpers.py index 8201f952a..1ef9e964e 100644 --- a/src/mailman/testing/helpers.py +++ b/src/mailman/testing/helpers.py @@ -1,4 +1,4 @@ -# Copyright (C) 2008-2013 by the Free Software Foundation, Inc. +# Copyright (C) 2008-2014 by the Free Software Foundation, Inc. # # This file is part of GNU Mailman. # @@ -46,6 +46,7 @@ import mock import time import uuid import errno +import shutil import signal import socket import logging @@ -326,6 +327,8 @@ def call_api(url, data=None, method=None, username=None, password=None): else: method = 'POST' method = method.upper() + if method in ('POST', 'PUT', 'PATCH') and data is None: + data = urlencode({}, doseq=True) basic_auth = '{0}:{1}'.format( (config.webservice.admin_user if username is None else username), (config.webservice.admin_pass if password is None else password)) @@ -478,6 +481,11 @@ def reset_the_world(): with transaction(): for message in message_store.messages: message_store.delete_message(message['message-id']) + # Delete any other residual messages. + for dirpath, dirnames, filenames in os.walk(config.MESSAGES_DIR): + for filename in filenames: + os.remove(os.path.join(dirpath, filename)) + shutil.rmtree(dirpath) # Reset the global style manager. getUtility(IStyleManager).populate() # Remove all dynamic header-match rules. |
