Esempio n. 1
0
    def setUp(self):
        create_users(self)
        create_games(self)

        # create a TreasureHunt game
        self.hunt = TreasureHuntGame()
        self.hunt.created_by = User.objects.get(pk=1)
        self.hunt.save()
Esempio n. 2
0
    def setUp(self):
        create_users(self)
        create_games(self)

        # most tests will need a response from a logged-in user,
        # who is the creator of the game
        self.game = Game.objects.get(pk=1)
        self.user = User.objects.get(pk=1)
        self.assertEqual(self.user, self.game.created_by)
        self.url = reverse(self.view, args=(self.game.pk,))
        self.assertTrue(self.client.login(username=self.user.username, password=self.user.username))
        self.response = self.client.get(self.url)
Esempio n. 3
0
    def setUp(self):
        create_users(self)
        create_games(self)
        create_players(self)

        # most tests will need a response from a logged-in user,
        # who is a player of the game, who gave a code for a location
        # from the game
        self.game = TreasureHuntGame.objects.all()[0]
        self.player = self.game.player_set.all()[0]
        self.user = self.player.user
        self.location = self.game.location_set.all()[0]
        self.url = reverse(self.view, args=(self.location.uuid,))
        self.assertTrue(self.client.login(username=self.user.username, password=self.user.username))
        self.response = self.client.get(self.url)
Esempio n. 4
0
    def setUp(self):
        create_users(self)
        create_games(self)

        self.response = self.client.get(self.url)