Commit 9ef4e0d3 authored by Vincent Pelletier's avatar Vincent Pelletier

Add a test for activity robustness to changeSkin call during activity.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19130 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c029d121
...@@ -2563,6 +2563,40 @@ class TestCMFActivity(ERP5TypeTestCase): ...@@ -2563,6 +2563,40 @@ class TestCMFActivity(ERP5TypeTestCase):
LOG('Testing... ',0,message) LOG('Testing... ',0,message)
self.TryActivityRaiseInCommitDoesNotLooseMessages('SQLQueue') self.TryActivityRaiseInCommitDoesNotLooseMessages('SQLQueue')
def TryChangeSkinInActivity(self, activity):
get_transaction().commit()
self.tic()
activity_tool = self.getActivityTool()
def changeSkinToNone(self):
self.getPortalObject().changeSkin(None)
Organisation.changeSkinToNone = changeSkinToNone
try:
organisation = self.getPortal().organisation_module.newContent(portal_type='Organisation')
get_transaction().commit()
self.tic()
organisation.activate(activity=activity).changeSkinToNone()
get_transaction().commit()
self.assertEquals(len(activity_tool.getMessageList()), 1)
self.flushAllActivities(silent=1, loop_size=100)
self.assertEquals(len(activity_tool.getMessageList()), 0)
finally:
delattr(Organisation, 'changeSkinToNone')
def test_100_ThreeMethodsWithFailureAndFlushThemSQLDict(self, quiet=0, run=run_all_test):
if not run: return
if not quiet:
message = '\nTry Change Skin In Activity (SQLDict)'
ZopeTestCase._print(message)
LOG('Testing... ',0,message)
self.TryChangeSkinInActivity('SQLDict')
def test_101_TryChangeSkinInActivitySQLQueue(self, quiet=0, run=run_all_test):
if not run: return
if not quiet:
message = '\nTry ChangeSkin In Activity (SQLQueue)'
ZopeTestCase._print(message)
LOG('Testing... ',0,message)
self.TryChangeSkinInActivity('SQLQueue')
def test_suite(): def test_suite():
suite = unittest.TestSuite() suite = unittest.TestSuite()
......
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