예제 #1
0
파일: tests.py 프로젝트: ArmandNM/wouso
    def test_custom_create(self):
        Challenge.WARRANTY = False
        game = ChallengeGame.get_instance()
        p1, p2 = self._get_player(1), self._get_player(2)

        challenge = Challenge.create_custom(p1, p2, [], game)
        self.assertTrue(challenge)
        self.assertEqual(challenge.owner, game)
예제 #2
0
    def test_custom_create(self):
        Challenge.WARRANTY = False
        game = ChallengeGame.get_instance()
        p1, p2 = self._get_player(1), self._get_player(2)

        challenge = Challenge.create_custom(p1, p2, [], game)
        self.assertTrue(challenge)
        self.assertEqual(challenge.owner, game)
예제 #3
0
파일: tests.py 프로젝트: cvicentiu/wouso
    def test_custom_create(self):
        game = ChallengeGame.get_instance()
        p1, p2 = self._get_player(1), self._get_player(2)

        challenge = Challenge.create_custom(p1, p2, [], game)
        self.assertTrue(challenge)
        self.assertEqual(challenge.owner, game)


# TODO: add page tests (views) for challenge run
예제 #4
0
파일: models.py 프로젝트: AndreiRO/wouso
 def update_challenge(self):
     """
     Create real challenge if status is Active
     """
     if self.is_active():
         if self.real_challenge:
             return
         self.real_challenge = Challenge.create_custom(self.player_from, self.player_to, self.questions.all(), SpecialChallengeGame.get_instance())
         self.save()
         if self.real_challenge:
             self.status = STATUS_PLAYABLE
             self.save()
예제 #5
0
 def update_challenge(self):
     """
     Create real challenge if status is Active
     """
     if self.is_active():
         if self.real_challenge:
             return
         self.real_challenge = Challenge.create_custom(self.player_from, self.player_to, self.questions.all(), SpecialChallengeGame.get_instance())
         self.save()
         if self.real_challenge:
             self.status = STATUS_PLAYABLE
             self.save()