Exemplo n.º 1
0
def test_game_player(dominion_fix):
    '''
    Tests creating games and connecting them to players.
    '''
    game = create_game(ruleset=None)
    player = create_player(name='test_player')

    player.games.append(game)
    player.save()
    gameplayer = GamePlayer(player=player)
    game.game_players[str(player.id)] = gameplayer
    game.save()

    assert game.game_players
    assert game.game_players[str(player.id)].player == player
    assert Player.objects(games=game) #@UndefinedVariable
Exemplo n.º 2
0
def test_player(dominion_fix):
    '''
    Tests creating a player and saving it to the DB.
    '''
    create_player(name='test_player')
    assert Player.objects(name='test_player') #@UndefinedVariable