entities/test/unittest_wfobjs.py
branchstable
changeset 5457 ab35bcdcb7c1
parent 5450 269dcd14b92c
child 5538 752bc67064f2
equal deleted inserted replaced
5456:d040889fac4e 5457:ab35bcdcb7c1
    54         wf = add_wf(self, 'Company')
    54         wf = add_wf(self, 'Company')
    55         wf.add_state(u'foo', initial=True)
    55         wf.add_state(u'foo', initial=True)
    56         self.commit()
    56         self.commit()
    57         wf.add_state(u'foo')
    57         wf.add_state(u'foo')
    58         ex = self.assertRaises(ValidationError, self.commit)
    58         ex = self.assertRaises(ValidationError, self.commit)
    59         self.assertEquals(ex.errors, {'name-subject': 'workflow already have a state of that name'})
    59         self.assertEquals(ex.errors, {'state_of-subject': 'workflow already have a state of that name'})
    60         # no pb if not in the same workflow
    60         # no pb if not in the same workflow
    61         wf2 = add_wf(self, 'Company')
    61         wf2 = add_wf(self, 'Company')
    62         foo = wf2.add_state(u'foo', initial=True)
    62         foo = wf2.add_state(u'foo', initial=True)
    63         self.commit()
    63         self.commit()
    64         # gnark gnark
    64         # gnark gnark
   430         wf = add_wf(self, 'Company')
   430         wf = add_wf(self, 'Company')
   431         wf.add_state('asleep', initial=True)
   431         wf.add_state('asleep', initial=True)
   432         self.execute('SET X custom_workflow WF WHERE X eid %(x)s, WF eid %(wf)s',
   432         self.execute('SET X custom_workflow WF WHERE X eid %(x)s, WF eid %(wf)s',
   433                      {'wf': wf.eid, 'x': self.member.eid})
   433                      {'wf': wf.eid, 'x': self.member.eid})
   434         ex = self.assertRaises(ValidationError, self.commit)
   434         ex = self.assertRaises(ValidationError, self.commit)
   435         self.assertEquals(ex.errors, {'in_state-subject': u"state doesn't apply to this entity's type"})
   435         self.assertEquals(ex.errors, {'custom_workflow-subject': u"workflow isn't a workflow for this type"})
   436 
   436 
   437     def test_del_custom_wf(self):
   437     def test_del_custom_wf(self):
   438         """member in some state shared by the new workflow, nothing has to be
   438         """member in some state shared by the new workflow, nothing has to be
   439         done
   439         done
   440         """
   440         """