def setUpTestData(cls):
     object_creation_helpers.createGenericAdmin()
Esempio n. 2
0
    def setUpTestData(cls):
        # set up an admin
        object_creation_helpers.createGenericAdmin()

        # set up a coordinator
        object_creation_helpers.createUser(Roles.coordinator, object_creation_helpers.generateUserDetails())

        # set up a supervisor
        object_creation_helpers.createUser(Roles.supervisor, object_creation_helpers.generateUserDetails())

        # set up a second primary supervisor
        object_creation_helpers.createUser(Roles.supervisor, object_creation_helpers.generateUserDetails())

        # set up a secondary supervisor
        object_creation_helpers.createUser(Roles.supervisor, object_creation_helpers.generateUserDetails())

        # set up a subject
        object_creation_helpers.createSubject('123', 'test_subject', 2)

        # set up three teams
        team_data = {
            "name": "team_1",
            "subject_code": '123',
            "supervisor_id": 3,
            "secondary_supervisor_id": 5,
            "year": "2020",
            "create_date": "01012020",
            "project_name": "test_project_1",
            "sprint_start_0": "1",
            "sprint_end_0": "1",
            "sprint_start_1": "1",
            "sprint_end_1": "1",
            "sprint_start_2": "1",
            "sprint_end_2": "1",
            "sprint_start_3": "1",
            "sprint_end_3": "1",
            "sprint_start_4": "1",
            "sprint_end_4": "1",
        }
        team = Team(name=team_data["name"],
                    subject_code=team_data["subject_code"],
                    supervisor_id=team_data["supervisor_id"],
                    secondary_supervisor_id=team_data["secondary_supervisor_id"],
                    year=team_data["year"],
                    create_date=team_data["create_date"],
                    project_name=team_data["project_name"],
                    sprint_start_0=team_data["sprint_start_0"],
                    sprint_end_0=team_data["sprint_end_0"],
                    sprint_start_1=team_data["sprint_start_1"],
                    sprint_end_1=team_data["sprint_end_1"],
                    sprint_start_2=team_data["sprint_start_2"],
                    sprint_end_2=team_data["sprint_end_2"],
                    sprint_start_3=team_data["sprint_start_3"],
                    sprint_end_3=team_data["sprint_end_3"],
                    sprint_start_4=team_data["sprint_start_4"],
                    sprint_end_4=team_data["sprint_end_4"],
                    )
        team.save()
        team_data = {
            "name": "team_2",
            "subject_code": '123',
            "supervisor_id": 3,
            "secondary_supervisor_id": 5,
            "year": "2020",
            "create_date": "01012020",
            "project_name": "test_project_2",
            "sprint_start_0": "1",
            "sprint_end_0": "1",
            "sprint_start_1": "1",
            "sprint_end_1": "1",
            "sprint_start_2": "1",
            "sprint_end_2": "1",
            "sprint_start_3": "1",
            "sprint_end_3": "1",
            "sprint_start_4": "1",
            "sprint_end_4": "1",
        }
        team = Team(name=team_data["name"],
                    subject_code=team_data["subject_code"],
                    supervisor_id=team_data["supervisor_id"],
                    secondary_supervisor_id=team_data["secondary_supervisor_id"],
                    year=team_data["year"],
                    create_date=team_data["create_date"],
                    project_name=team_data["project_name"],
                    sprint_start_0=team_data["sprint_start_0"],
                    sprint_end_0=team_data["sprint_end_0"],
                    sprint_start_1=team_data["sprint_start_1"],
                    sprint_end_1=team_data["sprint_end_1"],
                    sprint_start_2=team_data["sprint_start_2"],
                    sprint_end_2=team_data["sprint_end_2"],
                    sprint_start_3=team_data["sprint_start_3"],
                    sprint_end_3=team_data["sprint_end_3"],
                    sprint_start_4=team_data["sprint_start_4"],
                    sprint_end_4=team_data["sprint_end_4"],
                    )
        team.save()
        team_data = {
            "name": "team_3",
            "subject_code": '123',
            "supervisor_id": 4,
            "secondary_supervisor_id": 5,
            "year": "2020",
            "create_date": "01012020",
            "project_name": "test_project_3",
            "sprint_start_0": "1",
            "sprint_end_0": "1",
            "sprint_start_1": "1",
            "sprint_end_1": "1",
            "sprint_start_2": "1",
            "sprint_end_2": "1",
            "sprint_start_3": "1",
            "sprint_end_3": "1",
            "sprint_start_4": "1",
            "sprint_end_4": "1",
        }
        team = Team(name=team_data["name"],
                    subject_code=team_data["subject_code"],
                    supervisor_id=team_data["supervisor_id"],
                    secondary_supervisor_id=team_data["secondary_supervisor_id"],
                    year=team_data["year"],
                    create_date=team_data["create_date"],
                    project_name=team_data["project_name"],
                    sprint_start_0=team_data["sprint_start_0"],
                    sprint_end_0=team_data["sprint_end_0"],
                    sprint_start_1=team_data["sprint_start_1"],
                    sprint_end_1=team_data["sprint_end_1"],
                    sprint_start_2=team_data["sprint_start_2"],
                    sprint_end_2=team_data["sprint_end_2"],
                    sprint_start_3=team_data["sprint_start_3"],
                    sprint_end_3=team_data["sprint_end_3"],
                    sprint_start_4=team_data["sprint_start_4"],
                    sprint_end_4=team_data["sprint_end_4"],
                    )
        team.save()