def test_submit_for_review(self, mock_submit_for_review): node = StepInst(name='hello') node.assignees = ['student'] node.reviewers = ['teacher'] node.status = STATUS.IN_PROGRESS node.trigger('student') mock_submit_for_review.assert_called_once()
def test_in_progress_not_assignee(self): node = StepInst(name='hello') node.assignees = ['parent'] node.reviewers = ['teacher'] node.status = STATUS.IN_PROGRESS with self.assertRaises(CannotComplete): node.trigger('student')
def test_complete(self, mock_complete): node = StepInst(name='hello') node.assignees = ['student'] node.reviewers = ['teacher'] node.status = STATUS.READY_FOR_REVIEW node.trigger('teacher') mock_complete.assert_called_once()
def test_ready_for_review_not_reviewer(self): node = StepInst(name='hello') node.status = STATUS.READY_FOR_REVIEW node.reviewers = ['parent'] with self.assertRaises(CannotComplete): node.trigger('teacher')
def test_status_not_correct(self): node = StepInst(name='hello') node.assignees = ['student'] node.reviewers = ['teacher'] with self.assertRaises(CannotComplete): node.trigger('student')