def setUp(self):
        # login first
        login_helpers.login(self.client)

        # Create 2 coordinators
        first_name = names.get_first_name()
        last_name = names.get_last_name()
        coordinator_1_details = {
            "first_name": first_name, "last_name": last_name, "email": first_name + last_name + "@gmail.com"
        }
        object_creation_helpers.createUser(
            Roles.coordinator, coordinator_1_details)
        first_name = names.get_first_name()
        last_name = names.get_last_name()
        coordinator_2_details = {
            "first_name": first_name, "last_name": last_name, "email": first_name + last_name + "@gmail.com"
        }
        object_creation_helpers.createUser(
            Roles.coordinator, coordinator_2_details)

        # Create subjects and assign each coordinator to one of the two subjects
        coordinator_1_id = User.objects.get(
            email=coordinator_1_details["email"]).user_id
        coordinator_2_id = User.objects.get(
            email=coordinator_2_details["email"]).user_id
        object_creation_helpers.createSubject(
            "SWEN90013", "Master Advanced Software Project", coordinator_1_id)
        object_creation_helpers.createSubject(
            "SWEN90014", "Master Software Engineering Project", coordinator_2_id)
 def setUp(self):
     login_helpers.login(self.client)
     # Create a coordinator
     first_name = names.get_first_name()
     last_name = names.get_last_name()
     session = self.client.session
     session["coordinator_1_details"] = {
         "first_name": first_name, "last_name": last_name, "email": first_name + last_name + "@gmail.com"
     }
     session.save()
     object_creation_helpers.createUser(Roles.coordinator, session["coordinator_1_details"])
Exemple #3
0
    def setUp(self):
        login_helpers.login(self.client)
        # Set up atlassian credentials
        session = self.client.session
        session["user"]["atl_username"] = "******"
        session["user"]["atl_password"] = "******"
        session["team_body"] = {
            "team": "swen90013-2020-ce",
            "subject": "swen90013",
            "year": "2020",
            "project": "ce"
        }

        session.save()
Exemple #4
0
 def setUp(self):
     login_helpers.login(self.client)
     # Create a coordinator
     first_name = names.get_first_name()
     last_name = names.get_last_name()
     session = self.client.session
     session["coordinator_1_details"] = {
         "first_name": first_name,
         "last_name": last_name,
         "email": first_name + last_name + "@gmail.com"
     }
     session.save()
     object_creation_helpers.createUser(Roles.coordinator,
                                        session["coordinator_1_details"])
     coordinator_1_id = User.objects.get(
         email=session["coordinator_1_details"]["email"]).user_id
     object_creation_helpers.createSubject(
         "SWEN90013", "Master Advanced Software Project", coordinator_1_id)
    def setUp(self):
        login_helpers.login(self.client)
        team_data = {
            "name": "test_swen90013_2020_sp",
            "subject_code": '123',
            "supervisor_id": 2,
            "secondary_supervisor_id": 3,
            "year": "2020",
            "create_date": "01012020",
            "project_name": "sp",
            "sprint_start_0": "123456",
            "sprint_end_0": "123456",
            "sprint_start_1": "123456",
            "sprint_end_1": "123456",
            "sprint_start_2": "123456",
            "sprint_end_2": "123456",
            "sprint_start_3": "123456",
            "sprint_end_3": "123456",
            "sprint_start_4": "123456",
            "sprint_end_4": "123456",
        }
        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()

        self.team = Team.objects.get(name=team_data["name"])
    def setUp(self):
        # login first
        login_helpers.login(self.client)

        # Create 3 supervisors
        self.supervisors_names = {}
        # Note each supervisors' id offfset by 1 as there is an existing user before any of the supervisors -> admin
        for i in range(3):
            first_name = names.get_first_name()
            last_name = names.get_last_name()
            email = first_name + "@gmail.com"
            userDetails = {
                'first_name': first_name,
                'last_name': last_name,
                'email': email
            }
            self.supervisors_names[str(i + 2)] = {
                'first_name': first_name,
                'last_name': last_name,
                'full_name': first_name + ' ' + last_name
            }
            object_creation_helpers.createUser(Roles.supervisor, userDetails)
 def setUp(self):
     # login first
     login_helpers.login(self.client)
    def setUp(self):
        login_helpers.login(self.client)
        session = self.client.session
        # Set up a test team object
        team_data = {
            "name": "test_swen90013_2020_sp",
            "subject_code": '123',
            "supervisor_id": 2,
            "secondary_supervisor_id": 3,
            "year": "2020",
            "create_date": "01012020",
            "project_name": "sp",
            "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()

        self.team = Team.objects.get(name=team_data["name"])

        # Set up team member and student objects
        member_1_data = {
            "student_id": 1,
            "team_id": 1
        }
        member_2_data = {
            "student_id": 2,
            "team_id": 1
        }
        member_1 = TeamMember(student_id=member_1_data["student_id"],
                              team_id=member_1_data["team_id"])
        member_2 = TeamMember(student_id=member_2_data["student_id"],
                              team_id=member_2_data["team_id"])
        member_1.save()
        member_2.save()

        self.members = [member_1_data, member_2_data]

        student_1_data = {
            "fullname": "student1",
            "email": "*****@*****.**",
            "git_name": "student1",
            "slack_email": "*****@*****.**"
        }
        student_2_data = {
            "fullname": "student2",
            "email": "*****@*****.**",
            "git_name": "student2",
            "slack_email": "*****@*****.**"
        }
        student_1 = Student(fullname=student_1_data["fullname"],
                            email=student_1_data["email"],
                            git_name=student_1_data["git_name"],
                            slack_email=student_1_data["slack_email"])
        student_2 = Student(fullname=student_2_data["fullname"],
                            email=student_2_data["email"],
                            git_name=student_2_data["git_name"],
                            slack_email=student_2_data["slack_email"])
        student_1.save()
        student_2.save()

        self.students = [student_1_data, student_2_data]