def test_update_player_invalid_token(client, banker, player):
    response = client.put(
        f"/players/{player['user'].uuid}",
        headers={'x-access-token': auth_for_invalid_token(banker)},
        json={'fine_uuid': player['fine'].uuid})

    assert response.status_code == 401
    assert response.get_json()['message'] == 'token_invalid'
def test_get_player_list_first_page_invalid_token(client, test_list_players):
    response = client.get(
        '/players',
        headers={
            'x-access-token': auth_for_invalid_token(test_list_players[0])
        }
    )

    assert response.status_code == 401
    assert response.get_json()['message'] == 'token_invalid'
Exemple #3
0
def test_update_fine_invalid_token(
    client,
    conf_one_banker_one_team_many_fines,
):
    response = client.get(
        '/fines',
        headers={
            'x-access-token':
            auth_for_invalid_token(conf_one_banker_one_team_many_fines),
        })
    assert response.status_code == 401
    assert response.get_json()['message'] == 'token_invalid'
def test_create_fine_invalid_token(
    client,
    banker,
):
    response = client.post(
        '/fines',
        headers={
            'x-access-token': auth_for_invalid_token(banker),
        },
        json={
            'cost': 2,
            'label': 'dummy_fine',
        }
    )

    assert response.status_code == 401
    assert response.get_json()['message'] == 'token_invalid'
def test_delete_fine_invalid_token(
    client,
    conf_one_banker_one_team_many_fines,
):
    first_page = client.get('/fines',
                            headers={
                                'x-access-token':
                                auth_for(conf_one_banker_one_team_many_fines),
                            })
    fine_uuid = str(uuid.uuid4())

    response = client.delete(
        f'/fines/{fine_uuid}',
        headers={
            'x-access-token':
            auth_for_invalid_token(conf_one_banker_one_team_many_fines)
        },
    )

    assert response.status_code == 401
    assert response.get_json()['message'] == 'token_invalid'
Exemple #6
0
def test_update_fine_invalid_token(
    client,
    conf_one_banker_one_team_many_fines,
):
    first_page = client.get('/fines',
                            headers={
                                'x-access-token':
                                auth_for(conf_one_banker_one_team_many_fines),
                            })
    fine_uuid = str(uuid.uuid4())

    response = client.put(
        f'/fines/{fine_uuid}',
        headers={
            'x-access-token':
            auth_for_invalid_token(conf_one_banker_one_team_many_fines),
        },
        json={
            'label': 'new_label',
            'cost': 5
        })

    assert response.status_code == 401
    assert response.get_json()['message'] == 'token_invalid'