Example #1
0
    def test_cancel(self):
        # Given a team submission
        workflow = TeamStaffWorkflowFactory.create()

        # When I cancel through the API
        teams_api.on_cancel(workflow.team_submission_uuid)

        # The workflow, gets cancelled
        cancelled_workflow = TeamStaffWorkflow.objects.get(team_submission_uuid=workflow.team_submission_uuid)
        self.assertEqual(cancelled_workflow.cancelled_at, now())
Example #2
0
    def _create_test_workflow(self, team_submission_uuid, course_id=None, item_id=None):
        """
        Creates a test team workflow and links to a team submission

        Returns:
            Created workflow
        """
        workflow = TeamStaffWorkflowFactory.create()
        workflow.team_submission_uuid = team_submission_uuid
        workflow.course_id = course_id if course_id else workflow.course_id
        workflow.item_id = item_id if item_id else workflow.item_id
        workflow.save()

        return workflow
Example #3
0
    def _create_test_team(cls,
                          identifier,
                          team_member_ids,
                          create_submission=True):
        """Create a TestTeam, linking team members to a team ID, name, and possible team submission"""
        course_id = STUDENT_ITEM['course_id']
        item_id = STUDENT_ITEM['item_id']
        team_id = f"team_{identifier}_id"

        if create_submission:
            workflow = TeamStaffWorkflowFactory.create(course_id=course_id,
                                                       item_id=item_id)
            team_submission = workflow.team_submission_uuid
        else:
            team_submission = None

        return TestTeam(team_name=f"team_{identifier}_name",
                        team_id=team_id,
                        member_ids=team_member_ids,
                        team_submission=team_submission)
Example #4
0
 def create_workflow(cls, **kwargs):
     return TeamStaffWorkflowFactory.create(**kwargs)