entities/test/unittest_wfobjs.py
changeset 4028 062beb946b7c
parent 4024 6a14cff373c3
child 4030 6cfe4faddf8c
equal deleted inserted replaced
4027:02273e65e1c2 4028:062beb946b7c
   388     def test_custom_wf_bad_etype(self):
   388     def test_custom_wf_bad_etype(self):
   389         """try to set a custom workflow which doesn't apply to entity type"""
   389         """try to set a custom workflow which doesn't apply to entity type"""
   390         wf = add_wf(self, 'Company')
   390         wf = add_wf(self, 'Company')
   391         wf.add_state('asleep', initial=True)
   391         wf.add_state('asleep', initial=True)
   392         self.execute('SET X custom_workflow WF WHERE X eid %(x)s, WF eid %(wf)s',
   392         self.execute('SET X custom_workflow WF WHERE X eid %(x)s, WF eid %(wf)s',
   393                      {'wf': wf.eid, 'x': self.member.eid})
   393                      {'wf': wf.eid, 'x': self.member.eid}, 'x')
   394         ex = self.assertRaises(ValidationError, self.commit)
   394         ex = self.assertRaises(ValidationError, self.commit)
   395         self.assertEquals(ex.errors, {'custom_workflow': 'workflow isn\'t a workflow for this type'})
   395         self.assertEquals(ex.errors, {'custom_workflow': 'workflow isn\'t a workflow for this type'})
   396 
   396 
   397     def test_del_custom_wf(self):
   397     def test_del_custom_wf(self):
   398         """member in some state shared by the new workflow, nothing has to be
   398         """member in some state shared by the new workflow, nothing has to be