210 {'wf': wf.eid, 'x': self.member.eid}) |
210 {'wf': wf.eid, 'x': self.member.eid}) |
211 ex = self.assertRaises(ValidationError, self.commit) |
211 ex = self.assertRaises(ValidationError, self.commit) |
212 self.assertEquals(ex.errors, {'custom_workflow': u'workflow has no initial state'}) |
212 self.assertEquals(ex.errors, {'custom_workflow': u'workflow has no initial state'}) |
213 |
213 |
214 def test_custom_wf_bad_etype(self): |
214 def test_custom_wf_bad_etype(self): |
215 """try to set a custom workflow which has no initial state""" |
215 """try to set a custom workflow which doesn't apply to entity type""" |
216 self.member.fire_transition('deactivate') |
|
217 wf = add_wf(self, 'Company') |
216 wf = add_wf(self, 'Company') |
218 wf.add_state('asleep', initial=True) |
217 wf.add_state('asleep', initial=True) |
219 self.execute('SET X custom_workflow WF WHERE X eid %(x)s, WF eid %(wf)s', |
218 self.execute('SET X custom_workflow WF WHERE X eid %(x)s, WF eid %(wf)s', |
220 {'wf': wf.eid, 'x': self.member.eid}) |
219 {'wf': wf.eid, 'x': self.member.eid}) |
221 ex = self.assertRaises(ValidationError, self.commit) |
220 ex = self.assertRaises(ValidationError, self.commit) |