def test_one_callback(self):
    transition = Transition('test', sources=[], target='cancelled', callbacks=[disable_invoice])
    self.assertTrue(self.invoice.is_available)
    state = State(self.invoice, 'status')
    transition.change_state(state)
    self.assertEqual(self.invoice.status, transition.target)
    self.assertFalse(self.invoice.is_available)
    self.assertFalse(state.is_locked())
def test_one_callback(self):
    transition = Transition('test', sources=[], target='cancelled', callbacks=[disable_invoice])
    self.assertTrue(self.invoice.is_available)
    state = State(self.invoice, 'status')
    transition.change_state(state)
    self.assertEqual(self.invoice.status, transition.target)
    self.assertFalse(self.invoice.is_available)
    self.assertFalse(state.is_locked())