Commit 33024cf3 authored by Jérome Perrin's avatar Jérome Perrin

tests assignment workflow: closing an assignment should set the stop date to

the current date (this is currently failing because setStopDate is called in
the workflow script and the user does not have Modify portal content at this
stage)


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21173 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c00c3636
......@@ -1063,6 +1063,22 @@ class TestERP5Base(ERP5TypeTestCase):
age_as_text = person.Person_getAge(at_date=DateTime(2002, 2, 4))
self.assertEquals(age_as_text, "1 Years Old")
def test_AssignmentWorkflow(self):
person = self.getPersonModule().newContent(portal_type='Person',)
assignment = person.newContent(portal_type='Assignment')
self.assertEquals('draft', assignment.getValidationState())
self.portal.portal_workflow.doActionFor(assignment, 'open_action')
self.assertEquals('open', assignment.getValidationState())
self.portal.portal_workflow.doActionFor(assignment, 'update_action')
self.assertEquals('updated', assignment.getValidationState())
self.portal.portal_workflow.doActionFor(assignment, 'open_action')
self.assertEquals('open', assignment.getValidationState())
# date is set automatically when closing
self.assertEquals(None, assignment.getStopDate())
self.portal.portal_workflow.doActionFor(assignment, 'close_action')
self.assertEquals('closed', assignment.getValidationState())
self.assertNotEquals(None, assignment.getStopDate())
self.assertEquals(DateTime().day(), assignment.getStopDate().day())
def test_suite():
......
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