import json


def api_client(api_client_unauth):
    """A authenticated test client for the JSON API."""
    data = {'username': 'test',
            'password': 'password_test'}
    response = api_client_unauth.post(
        '/api/signin', data=json.dumps(data)
    )

    assert response.status_code == 200

    return api_client_unauth