capture outgoing emails

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32079 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a7c73d62
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
import transaction import transaction
from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase from Products.ERP5Type.tests.ERP5TypeTestCase import ERP5TypeTestCase
from Products.ERP5Type.tests.utils import FileUpload from Products.ERP5Type.tests.utils import FileUpload, DummyMailHost
from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
from Products.ERP5OOo.OOoUtils import OOoParser from Products.ERP5OOo.OOoUtils import OOoParser
from AccessControl.SecurityManagement import newSecurityManager from AccessControl.SecurityManagement import newSecurityManager
...@@ -57,6 +57,7 @@ class TestInvoiceMixin(TestPackingListMixin, ...@@ -57,6 +57,7 @@ class TestInvoiceMixin(TestPackingListMixin,
cpt_incoterm = 'cpt' cpt_incoterm = 'cpt'
unit_piece_quantity_unit = 'unit/piece' unit_piece_quantity_unit = 'unit/piece'
mass_quantity_unit = 'mass/kg' mass_quantity_unit = 'mass/kg'
oldMailhost = None
# (account_id, account_gap, account_type) # (account_id, account_gap, account_type)
account_definition_list = ( account_definition_list = (
...@@ -119,10 +120,18 @@ class TestInvoiceMixin(TestPackingListMixin, ...@@ -119,10 +120,18 @@ class TestInvoiceMixin(TestPackingListMixin,
self.createCategories() self.createCategories()
self.validateRules() self.validateRules()
self.login() self.login()
self.oldMailHost = getattr(self.portal, 'MailHost', None)
if self.oldMailHost is not None:
self.portal.manage_delObjects(['MailHost'])
self.portal._setObject('MailHost', DummyMailHost('MailHost'))
def beforeTearDown(self): def beforeTearDown(self):
transaction.abort() transaction.abort()
self.tic() self.tic()
# restore the original MailHost
if self.oldMailHost is not None:
self.portal.manage_delObjects(['MailHost'])
self.portal._setObject('MailHost', DummyMailHost('MailHost'))
for folder in (self.portal.accounting_module, for folder in (self.portal.accounting_module,
self.portal.organisation_module, self.portal.organisation_module,
self.portal.sale_order_module, self.portal.sale_order_module,
......
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