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)
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
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()