A multipurpose python flask API server and administration SPA
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
540 B

  1. from flask.testing import FlaskClient
  2. from tests.conftest import AuthActions
  3. def test_get_user_happy_path(auth: AuthActions, client: FlaskClient):
  4. auth.login()
  5. auth_header = auth.get_authorization_header_token()
  6. result = client.get(
  7. '/user/{}'.format(client.application.config['test_username']),
  8. headers={
  9. auth_header[0]: auth_header[1]
  10. })
  11. assert result.status_code == 200
  12. assert result.json is not None
  13. assert result.json['name'] == client.application.config['test_username']