Commit b6f79b68 authored by Julien Muchembled's avatar Julien Muchembled

ERP5Site_setupDummyMailHost: do not replace MailHost permanently

Similar to commit cc7b1372
parent 744ccd3b
...@@ -26,14 +26,16 @@ ...@@ -26,14 +26,16 @@
# #
############################################################################## ##############################################################################
from ExtensionClass import pmc_init_of
from Products.ERP5Type.tests.utils import DummyMailHost from Products.ERP5Type.tests.utils import DummyMailHost
def setupDummyMailHost(self): def setupDummyMailHost(self):
portal = self.getPortalObject() """Replace Original Mail Host by Dummy Mail Host in a non-persistent way
# Replace MailHost by DummyMailHost
if 'MailHost' in portal.objectIds():
portal.manage_delObjects(['MailHost'])
portal._setObject('MailHost', DummyMailHost('MailHost'))
return True
Copied & pasted from ERP5TypeTestCaseMixin._setUpDummyMailHost
"""
cls = self.getPortalObject().portal.MailHost.__class__
if not issubclass(cls, DummyMailHostMixin):
cls.__bases__ = (DummyMailHostMixin,) + cls.__bases__
pmc_init_of(cls)
return True
56 57
\ No newline at end of file \ No newline at end of file
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