entities/test/unittest_wfobjs.py
changeset 4030 6cfe4faddf8c
parent 4028 062beb946b7c
child 4644 021035b9a7ab
equal deleted inserted replaced
4029:e50a6b70c8e4 4030:6cfe4faddf8c
    43         foo = wf2.add_state(u'foo', initial=True)
    43         foo = wf2.add_state(u'foo', initial=True)
    44         self.commit()
    44         self.commit()
    45         # gnark gnark
    45         # gnark gnark
    46         bar = wf.add_state(u'bar')
    46         bar = wf.add_state(u'bar')
    47         self.commit()
    47         self.commit()
    48         print '*'*80
       
    49         bar.set_attributes(name=u'foo')
    48         bar.set_attributes(name=u'foo')
    50         ex = self.assertRaises(ValidationError, self.commit)
    49         ex = self.assertRaises(ValidationError, self.commit)
    51         self.assertEquals(ex.errors, {'name': 'workflow already have a state of that name'})
    50         self.assertEquals(ex.errors, {'name': 'workflow already have a state of that name'})
    52 
    51 
    53     def test_duplicated_transition(self):
    52     def test_duplicated_transition(self):
   232         self.assertEquals(self.group.subworkflow_input_transition(), None)
   231         self.assertEquals(self.group.subworkflow_input_transition(), None)
   233         # force back to swfstate1 is impossible since we can't any more find
   232         # force back to swfstate1 is impossible since we can't any more find
   234         # subworkflow input transition
   233         # subworkflow input transition
   235         ex = self.assertRaises(ValidationError,
   234         ex = self.assertRaises(ValidationError,
   236                                self.group.change_state, swfstate1, u'gadget')
   235                                self.group.change_state, swfstate1, u'gadget')
   237         self.assertEquals(ex.errors, {'to_state': "state doesn't belong to entity's current workflow"})
   236         self.assertEquals(ex.errors, {'to_state': "state doesn't belong to entity's workflow"})
   238         self.rollback()
   237         self.rollback()
   239         # force back to state1
   238         # force back to state1
   240         self.group.change_state('state1', u'gadget')
   239         self.group.change_state('state1', u'gadget')
   241         self.group.fire_transition('swftr1', u'au')
   240         self.group.fire_transition('swftr1', u'au')
   242         self.group.clear_all_caches()
   241         self.group.clear_all_caches()