Commit 5fb1b020 authored by Jérome Perrin's avatar Jérome Perrin

don't use user interface transitions workflow methods when the object is not in a consistent state


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21171 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b5e578d9
...@@ -223,10 +223,20 @@ class TestCalendar(ERP5TypeTestCase): ...@@ -223,10 +223,20 @@ class TestCalendar(ERP5TypeTestCase):
Confirm group calendar Confirm group calendar
""" """
group_calendar = sequence.get('group_calendar') group_calendar = sequence.get('group_calendar')
group_calendar.confirm()
self.assertEquals('confirmed', group_calendar.getSimulationState())
def stepConfirmActionGroupCalendar(self, sequence=None,
sequence_list=None, **kw):
"""
Confirm group calendar with user interface transition
"""
group_calendar = sequence.get('group_calendar')
self.portal.portal_workflow.doActionFor( self.portal.portal_workflow.doActionFor(
group_calendar, group_calendar,
'confirm_action', 'confirm_action',
'group_calendar_workflow') 'group_calendar_workflow')
self.assertEquals('confirmed', group_calendar.getSimulationState())
def stepCreateLeaveRequest(self, sequence=None, def stepCreateLeaveRequest(self, sequence=None,
...@@ -306,10 +316,8 @@ class TestCalendar(ERP5TypeTestCase): ...@@ -306,10 +316,8 @@ class TestCalendar(ERP5TypeTestCase):
Plan personal calendar Plan personal calendar
""" """
leave_request = sequence.get('leave_request') leave_request = sequence.get('leave_request')
self.portal.portal_workflow.doActionFor( leave_request.plan()
leave_request, self.assertEquals('planned', leave_request.getSimulationState())
'plan_action',
'leave_request_workflow')
def stepConfirmLeaveRequest(self, sequence=None, def stepConfirmLeaveRequest(self, sequence=None,
sequence_list=None, **kw): sequence_list=None, **kw):
...@@ -317,10 +325,8 @@ class TestCalendar(ERP5TypeTestCase): ...@@ -317,10 +325,8 @@ class TestCalendar(ERP5TypeTestCase):
Confirm personal calendar Confirm personal calendar
""" """
leave_request = sequence.get('leave_request') leave_request = sequence.get('leave_request')
self.portal.portal_workflow.doActionFor( leave_request.confirm()
leave_request, self.assertEquals('confirmed', leave_request.getSimulationState())
'confirm_action',
'leave_request_workflow')
def getSqlUidList(self): def getSqlUidList(self):
""" """
...@@ -569,9 +575,9 @@ class TestCalendar(ERP5TypeTestCase): ...@@ -569,9 +575,9 @@ class TestCalendar(ERP5TypeTestCase):
SetGroupPresencePeriodValues \ SetGroupPresencePeriodValues \
Tic \ Tic \
SetGroupPresencePeriodToCheck \ SetGroupPresencePeriodToCheck \
ConfirmGroupCalendar \
SetGroupPresencePeriodDates \ SetGroupPresencePeriodDates \
SetGroupPresencePeriodPerStopDate \ SetGroupPresencePeriodPerStopDate \
ConfirmActionGroupCalendar \
Tic \ Tic \
CheckCatalogued \ CheckCatalogued \
CheckGetTimeAvailability \ CheckGetTimeAvailability \
...@@ -588,9 +594,9 @@ class TestCalendar(ERP5TypeTestCase): ...@@ -588,9 +594,9 @@ class TestCalendar(ERP5TypeTestCase):
SetGroupPresencePeriodValues \ SetGroupPresencePeriodValues \
Tic \ Tic \
SetGroupPresencePeriodToCheck \ SetGroupPresencePeriodToCheck \
ConfirmGroupCalendar \
SetGroupPresencePeriodDates \ SetGroupPresencePeriodDates \
SetGroupPresencePeriodPerStopDate \ SetGroupPresencePeriodPerStopDate \
ConfirmActionGroupCalendar \
Tic \ Tic \
CheckCatalogued \ CheckCatalogued \
CheckGetTimeAvailability \ CheckGetTimeAvailability \
...@@ -609,9 +615,9 @@ class TestCalendar(ERP5TypeTestCase): ...@@ -609,9 +615,9 @@ class TestCalendar(ERP5TypeTestCase):
Tic \ Tic \
SetGroupPresencePeriodToCheck \ SetGroupPresencePeriodToCheck \
PlanGroupCalendar \ PlanGroupCalendar \
ConfirmGroupCalendar \
SetGroupPresencePeriodDates \ SetGroupPresencePeriodDates \
SetGroupPresencePeriodPerStopDate \ SetGroupPresencePeriodPerStopDate \
ConfirmActionGroupCalendar \
Tic \ Tic \
CheckCatalogued \ CheckCatalogued \
CheckDoubleGetTimeAvailability \ CheckDoubleGetTimeAvailability \
...@@ -648,9 +654,9 @@ class TestCalendar(ERP5TypeTestCase): ...@@ -648,9 +654,9 @@ class TestCalendar(ERP5TypeTestCase):
SetGroupPresencePeriodValues \ SetGroupPresencePeriodValues \
Tic \ Tic \
SetGroupPresencePeriodToCheck \ SetGroupPresencePeriodToCheck \
ConfirmGroupCalendar \
SetGroupPresencePeriodDates \ SetGroupPresencePeriodDates \
SetGroupPresencePeriodPerStopDate \ SetGroupPresencePeriodPerStopDate \
ConfirmActionGroupCalendar \
Tic \ Tic \
CheckCatalogued \ CheckCatalogued \
CheckGetTimeAvailability \ CheckGetTimeAvailability \
......
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