equal
deleted
inserted
replaced
108 |
108 |
109 def test_set_in_state_bad_wf(self): |
109 def test_set_in_state_bad_wf(self): |
110 wf = add_wf(self, 'CWUser') |
110 wf = add_wf(self, 'CWUser') |
111 s = wf.add_state(u'foo', initial=True) |
111 s = wf.add_state(u'foo', initial=True) |
112 self.commit() |
112 self.commit() |
113 ex = self.assertRaises(ValidationError, self.session().unsafe_execute, |
113 ex = self.assertRaises(ValidationError, self.session.unsafe_execute, |
114 'SET X in_state S WHERE X eid %(x)s, S eid %(s)s', |
114 'SET X in_state S WHERE X eid %(x)s, S eid %(s)s', |
115 {'x': self.user().eid, 's': s.eid}, 'x') |
115 {'x': self.user().eid, 's': s.eid}, 'x') |
116 self.assertEquals(ex.errors, {'in_state': "state doesn't belong to entity's workflow. " |
116 self.assertEquals(ex.errors, {'in_state': "state doesn't belong to entity's workflow. " |
117 "You may want to set a custom workflow for this entity first."}) |
117 "You may want to set a custom workflow for this entity first."}) |
118 |
118 |