Skip to content

web_client

Scope: function | Returns: FlaskClient

The web_client fixture provides an authenticated HTTP test client for the admin user. Use it to test endpoints that require authentication. The underlying dependency container is bootstrapped by webserver_service_locator.

Warning

Only one web client fixture (web_client, web_client_non_admin, web_client_other_non_admin, api_client) can be used in a single test.

Basic usage

def test_endpoint(web_client, prefix_url):
    response = web_client.get(prefix_url("api/v1/limeobject/company/"))

    assert response.status_code == 200