Commit 88a1ec3f authored by Julien Muchembled's avatar Julien Muchembled

Revert r38137 partially to clean up activities even if beforeTearDown is overridden

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/amount_generator@38145 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6c4d72ab
......@@ -992,14 +992,17 @@ class ERP5TypeTestCase(ProcessingNodeTestCase, PortalTestCase):
% title) # run_unit_test depends on this string.
raise
def afterClear(self):
'''Called after the fixture has been cleared.
Note that this may occur during setUp() *and*
tearDown().
'''
setSite() # undo site configuration from self.getPortal()
def tearDown(self):
'''Tears down the fixture. Do not override,
use the hooks instead.
'''
PortalTestCase.tearDown(self)
setSite() # undo site configuration from self.getPortal()
def beforeTearDown(self):
if not int(os.environ.get('erp5_save_data_fs', 0)):
# Drop remaining activities if some of them failed.
# However, we should not do more activity cleaning, because properly
......@@ -1011,14 +1014,16 @@ class ERP5TypeTestCase(ProcessingNodeTestCase, PortalTestCase):
except AttributeError:
pass
else:
for m in self.portal.portal_activities.getMessageList():
for m in portal_activities.getMessageList():
if m.processing_node < -1:
transaction.abort()
count = portal_activities.countMessage()
portal_activities.manageClearActivities(keep=False)
transaction.commit()
ZopeTestCase._print('\ndropped %d left-over activity messages'
% count)
break
PortalTestCase.tearDown(self)
def stepPdb(self, sequence=None, sequence_list=None):
"""Invoke debugger"""
......
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