from flask.testing import FlaskClient from tests.conftest import AuthActions def test_get_user_happy_path(auth: AuthActions, client: FlaskClient): auth.login() auth_header = auth.get_authorization_header_token() result = client.get( '/user/{}'.format(client.application.config['test_username']), headers={ auth_header[0]: auth_header[1] }) assert result.status_code == 200 assert result.json is not None assert result.json['name'] == client.application.config['test_username']