Example #1
0
    def setUp(self):
        """
        Sets up a test team prize for the rest of the tests.
        This prize is not saved, as the round field is not yet set.
        """
        self.prize = test_utils.setup_prize(award_to="team_group",
                                            competition_type="points")

        self.current_round = "Round 1"
        test_utils.set_competition_round()

        # Create test groups, teams, and users.
        self.groups = [Group(name="Test Group %d" % i) for i in range(0, 2)]
        _ = [d.save() for d in self.groups]

        self.teams = [
            Team(name=str(i), group=self.groups[i % 2]) for i in range(0, 4)
        ]
        _ = [f.save() for f in self.teams]

        self.users = [
            User.objects.create_user("test%d" % i, "*****@*****.**")
            for i in range(0, 4)
        ]

        # Assign users to teams.
        for index, user in enumerate(self.users):
            user.get_profile().team = self.teams[index % 4]
            user.get_profile().save()
Example #2
0
    def setUp(self):
        """
        Sets up a test team overall prize for the rest of the tests.
        This prize is not saved, as the round field is not yet set.
        """
        self.prize = test_utils.setup_prize(award_to="team_overall", competition_type="points")

        self.current_round = "Round 1"
        test_utils.set_competition_round()
        test_utils.create_teams(self)
Example #3
0
    def setUp(self):
        """
        Sets up a test team overall prize for the rest of the tests.
        This prize is not saved, as the round field is not yet set.
        """
        self.prize = test_utils.setup_prize(award_to="team_overall",
                                            competition_type="points")

        self.current_round = "Round 1"
        test_utils.set_competition_round()
        test_utils.create_teams(self)
    def setUp(self):
        """
        Sets up a test individual prize for the rest of the tests.
        This prize is not saved, as the round field is not yet set.
        """
        self.prize = test_utils.setup_prize(award_to="individual_overall",
                                            competition_type="points")

        self.current_round = "Round 1"

        test_utils.set_competition_round()

        # Create test users.
        self.users = [User.objects.create_user("test%d" % i, "*****@*****.**") for i in range(0, 3)]
Example #5
0
    def setUp(self):
        """
        Sets up a test individual prize for the rest of the tests.
        This prize is not saved, as the round field is not yet set.
        """
        self.prize = test_utils.setup_prize(award_to="individual_overall",
                                            competition_type="points")

        self.current_round = "Round 1"

        test_utils.set_competition_round()

        # Create test users.
        self.users = [
            User.objects.create_user("test%d" % i, "*****@*****.**")
            for i in range(0, 3)
        ]
Example #6
0
    def setUp(self):
        """
        Sets up a test team prize for the rest of the tests.
        This prize is not saved, as the round field is not yet set.
        """
        self.prize = test_utils.setup_prize(award_to="team_group", competition_type="points")

        self.current_round = "Round 1"
        test_utils.set_competition_round()

        # Create test groups, teams, and users.
        self.groups = [Group(name="Test Group %d" % i) for i in range(0, 2)]
        _ = [d.save() for d in self.groups]

        self.teams = [Team(name=str(i), group=self.groups[i % 2]) for i in range(0, 4)]
        _ = [f.save() for f in self.teams]

        self.users = [User.objects.create_user("test%d" % i, "*****@*****.**") for i in range(0, 4)]

        # Assign users to teams.
        for index, user in enumerate(self.users):
            user.profile.team = self.teams[index % 4]
            user.profile.save()