Ejemplo n.º 1
0
 def test_get_players_information_empty(self):
     # Initialize
     larp = Larp(name="")
     # Get information
     missing_info = larp.get_players_information()
     # Validate
     self.assertIs(len(missing_info), 0)
Ejemplo n.º 2
0
def create_all_without_profiles():
    larp = Larp(name="")
    larp.save()
    group = Group(larp=larp, name="")
    group.save()
    create_characters_assigments(group=group,
                                 players=example_players_incomplete)
    return larp
Ejemplo n.º 3
0
def create_group(group_name=""):
    group_search = Group.objects.filter(name=group_name)
    if group_search:
        return group_search[0]
    larp = Larp(name=larp_name())
    larp.save()
    group = Group(larp=larp, name=group_name)
    group.save()
    return group
Ejemplo n.º 4
0
def create_larp_with_diet_info(players_info=example_players_with_diets1,
                               characters_names=example_characters1,
                               diet_info="",
                               group_name="",
                               larp_name=""):
    create_diets()
    larp = Larp(name=larp_name)
    larp.save()
    create_group_with_diet_info(larp,
                                players_info,
                                characters_names,
                                diet_info=diet_info,
                                group_name=group_name)
    return larp
Ejemplo n.º 5
0
 def test_bookings_no_comments(self):
     """
     bookings_no_comments()
     """
     test_user = User(username="******", first_name="Ana", last_name="Garcia")
     test_larp = Larp(name="Blue Flame")
     test_bookings = Bookings(user=test_user, larp=test_larp, run=1)
     self.assertIs(test_bookings.comments, "no")
Ejemplo n.º 6
0
 def test_create_bookings(self):
     """
     create_bookings()
     """
     test_user = User(username="******", first_name="Ana", last_name="Garcia")
     test_larp = Larp(name="Blue Flame")
     test_bookings = Bookings(user=test_user, larp=test_larp, run=1)
     self.assertIs(test_bookings.user.username, "ana")
     self.assertEqual(str(test_bookings), "Blue Flame run 1 - Ana Garcia")
Ejemplo n.º 7
0
 def test_bookings_weapon(self):
     """
     bookings_weapon()
     """
     test_user = User(username="******", first_name="Ana", last_name="Garcia")
     test_larp = Larp(name="Blue Flame")
     test_bookings = Bookings(user=test_user, larp=test_larp, run=1)
     test_bookings.weapon = True
     self.assertIs(test_bookings.weapon, True)
Ejemplo n.º 8
0
 def test_bookings_bus(self):
     """
     bookings_bus()
     """
     test_user = User(username="******", first_name="Ana", last_name="Garcia")
     test_larp = Larp(name="Blue Flame")
     test_bookings = Bookings(user=test_user, larp=test_larp, run=1)
     bus_option1 = BusStop(name="Madrid_1")
     test_bookings.bus = bus_option1
     self.assertIs(test_bookings.bus.name, "Madrid_1")
Ejemplo n.º 9
0
 def test_bookings_accomodations(self):
     """
     bookings_accomodations()
     """
     test_user = User(username="******", first_name="Ana", last_name="Garcia")
     test_larp = Larp(name="Blue Flame")
     test_bookings = Bookings(user=test_user, larp=test_larp, run=1)
     accomodation1 = Accomodation(name="In game")
     test_bookings.accomodation = accomodation1
     test_bookings.sleeping_bag = False
     self.assertIs(test_bookings.accomodation.name, "In game")
     self.assertIs(test_bookings.sleeping_bag, False)
Ejemplo n.º 10
0
 def test_create_character_assigment(self):
     """
     create_character_assigment assigns a character to a player on a concrete larp run for a character without a group.
     """
     user = User(username="******", first_name="Ana", last_name="Garcia")
     larp = Larp(name=larp_name())
     empty_group = Group(name="", larp=larp)
     character = Character(group=empty_group, name="Marie Curie")
     character_assigment = CharacterAssigment(run=1,
                                              character=character,
                                              user=user)
     self.assertIs(character_assigment.character.name, "Marie Curie")
     self.assertIs(character_assigment.character.group.larp, larp)
     self.assertEqual(character_assigment.character.group.larp.name,
                      larp_name())
     self.assertIs(character_assigment.user.username, "ana")
     self.assertEqual(
         str(character_assigment),
         larp_name() + " run 1 - Marie Curie assigned to Ana Garcia")
Ejemplo n.º 11
0
 def test_create_character_assigment_without_user(self):
     """
     create_character_assigment assigns a character to a larp run but without an asigned user.
     This is useful when you have a new character that has no player assigned yet.
     """
     larp = Larp(name=larp_name())
     group_name = example_groups[1]
     group = Group(larp=larp, name=group_name)
     character = Character(group=group, name="Marie Curie")
     character_assigment = CharacterAssigment(run=1, character=character)
     self.assertIs(character_assigment.character.group.larp, larp)
     self.assertEqual(character_assigment.character.group.larp.name,
                      larp_name())
     self.assertIs(character_assigment.character, character)
     self.assertEqual(character_assigment.character.name,
                      example_characters[0])
     self.assertIs(character_assigment.character.group, group)
     self.assertEqual(character_assigment.character.group.name,
                      example_groups[1])
     self.assertEqual(str(character_assigment),
                      larp_name() + " run 1 - Marie Curie")