Commit 9bdf42ec authored by Jérome Perrin's avatar Jérome Perrin

added a DummyMailhost object



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10093 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 344e04c3
...@@ -26,9 +26,25 @@ ...@@ -26,9 +26,25 @@
# #
############################################################################## ##############################################################################
"""Utility functions for unit testing """Utility functions and classes for unit testing
""" """
from Products.MailHost.MailHost import MailHost
class DummyMailHost(MailHost):
"""Dummy Mail Host that doesn't really send messages and keep a copy in
_last_message attrbute.
To use it, you have to replace existing mailhost in afterSetUp:
if 'MailHost' in portal.objectIds():
portal.manage_delObjects(['MailHost'])
portal._setObject('MailHost', DummyMailHost('MailHost'))
"""
_last_message = ()
def _send( self, mfrom, mto, messageText ):
"""Record message in _last_message."""
self._last_message = (mfrom, mto, messageText)
def createZODBPythonScript(container, script_id, script_params, def createZODBPythonScript(container, script_id, script_params,
script_content): script_content):
"""Creates a Python script `script_id` in the given `container`, with """Creates a Python script `script_id` in the given `container`, with
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment