Commit 9f43c3e1 authored by Romain Courteaud's avatar Romain Courteaud Committed by Rafael Monnerat

slapos_cloud: stop using _simulateScript

parent 06849930
...@@ -666,35 +666,23 @@ return %s""" % (script_name, fake_return )) ...@@ -666,35 +666,23 @@ return %s""" % (script_name, fake_return ))
self.portal.portal_skins.custom.manage_delObjects(script_name) self.portal.portal_skins.custom.manage_delObjects(script_name)
transaction.commit() transaction.commit()
def assertScriptVisited(self, document, script_name):
self.assertEqual(
'Visited by %s' % script_name,
document.workflow_history['edit_workflow'][-1]['comment'])
def assertScriptNotVisited(self, document, script_name):
self.assertNotEqual(
'Visited by %s' % script_name,
document.workflow_history['edit_workflow'][-1]['comment'])
def _test_alarm(self, alarm, document, script_name): def _test_alarm(self, alarm, document, script_name):
self.tic() self.tic()
self._simulateScript(script_name) with TemporaryAlarmScript(self.portal, script_name):
try:
alarm.activeSense() alarm.activeSense()
self.tic() self.tic()
finally: self.assertEqual(
self._dropScript(script_name) 'Visited by %s' % script_name,
self.assertScriptVisited(document, script_name) document.workflow_history['edit_workflow'][-1]['comment'])
def _test_alarm_not_visited(self, alarm, document, script_name): def _test_alarm_not_visited(self, alarm, document, script_name):
self.tic() self.tic()
self._simulateScript(script_name) with TemporaryAlarmScript(self.portal, script_name):
try:
alarm.activeSense() alarm.activeSense()
self.tic() self.tic()
finally: self.assertNotEqual(
self._dropScript(script_name) 'Visited by %s' % script_name,
self.assertScriptNotVisited(document, script_name) document.workflow_history['edit_workflow'][-1]['comment'])
def restoreAccountingTemplatesOnPreferences(self): def restoreAccountingTemplatesOnPreferences(self):
self.login() self.login()
......
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