Esempio n. 1
0
 def setUp(self):
     Landmark.objects.all().delete()
     lm = Landmark(name="dummy",
                   clue="dummy",
                   question="dummy",
                   answer="dummy",
                   order_num=-1)
     lm.save()
     self.maker1 = gamemaker.GameMaker()
Esempio n. 2
0
 def setUp(self):
     dummy_landmark = Landmark(name="dummy",
                               clue="dummy",
                               question="dummy",
                               answer="dummy",
                               order_num=-1)
     dummy_landmark.save()
     team1 = HuntUser(name="team1",
                      password="******",
                      current_landmark=dummy_landmark)
     team1.save()
     self.t = team.Team()
Esempio n. 3
0
 def setUp(self):
     HuntUser.objects.all().delete()
     Landmark.objects.all().delete()
     Game.objects.all().delete()
     game = Game(name="game", running=False)
     game.save()
     lm = Landmark(name="dummy",
                   clue="dummy",
                   question="dummy",
                   answer="dummy",
                   order_num=-1)
     lm.save()
     self.maker = gamemaker.GameMaker()
Esempio n. 4
0
 def setUp(self):
     Landmark.objects.all().delete()
     dummy_landmark = Landmark(name="dummy",
                               clue="dummy",
                               question="dummy",
                               answer="dummy",
                               order_num=-1)
     dummy_landmark.save()
     self.team1 = HuntUser(name="team1",
                           password="******",
                           current_landmark=dummy_landmark)
     self.team1.save()
     self.assertEqual("team1", self.team1.name,
                      "Error: username not initialized correctly")
Esempio n. 5
0
 def setUp(self):
     dummy_landmark = Landmark(name="dummy",
                               clue="dummy",
                               question="dummy",
                               answer="dummy",
                               order_num=-1)
     dummy_landmark.save()
     Game.objects.all().delete()
     game = Game(name="game", running=False)
     game.save()
     self.maker = gamemaker.GameMaker()
     self.maker.make_team(["team1", "password1"])
     self.maker.make_team(["team2", "password1"])
     self.maker.add_landmark(["landmark1", "clue1", "q1", "a1"])
     self.maker.add_landmark(["landmark2", "clue2", "q2", "a2"])
     self.maker.create_game(["landmark1", "landmark2"])
     self.t = team.Team()
Esempio n. 6
0
 def setUp(self):
     Landmark.objects.all().delete()
     dummy_landmark = Landmark(name="dummy",
                               clue="dummy",
                               question="dummy",
                               answer="dummy",
                               order_num=-1)
     dummy_landmark.save()
     team1 = HuntUser(name="team1",
                      password="******",
                      current_landmark=dummy_landmark)
     team1.save()
     Game.objects.all().delete()
     self.game = Game(name="game", running=False)
     self.game.save()
     self.t = team.Team()
     self.maker = gamemaker.GameMaker()
Esempio n. 7
0
 def add_landmark(self, input):
     # input: List of length 4
     if len(input) != 4:
         return "Invalid input!"
     name = input[0]
     clue = input[1]
     question = input[2]
     answer = input[3]
     try:
         # Check that no landmarks of the same name are already in the database
         Landmark.objects.get(name=name)
     except Landmark.DoesNotExist:
         # If the landmark doesn't exist, add it to the database
         lm = Landmark(name=name,
                       clue=clue,
                       question=question,
                       answer=answer)
         lm.save()
         return "Landmark " + name + " has been added!"
     # Should only get here if a landmark of the same name exists
     return "Landmark " + name + " already exists!"
Esempio n. 8
0
 def setUp(self):
     HuntUser.objects.all().delete()
     Landmark.objects.all().delete()
     Game.objects.all().delete()
     game = Game(name="game", running=False)
     game.save()
     lm = Landmark(name="dummy",
                   clue="dummy",
                   question="dummy",
                   answer="dummy",
                   order_num=-1)
     lm.save()
     self.maker = gamemaker.GameMaker()
     self.maker.make_team(["team1", "password1"])
     self.t = team.Team()
     lm1 = Landmark(name="landmark1",
                    clue="clue1",
                    question="question1",
                    answer="answer1",
                    order_num=-1)
     lm2 = Landmark(name="landmark2",
                    clue="clue2",
                    question="question2",
                    answer="answer2",
                    order_num=-1)
     lm1.save()
     lm2.save()