Skip to content

Commit

Permalink
fastapi status code usage
Browse files Browse the repository at this point in the history
  • Loading branch information
justinthelaw committed Oct 1, 2024
1 parent 76efca3 commit 1211e69
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/utils/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import pytest
import requests
from requests import Response
from fastapi import status

ANON_KEY = os.environ["ANON_KEY"]
SERVICE_KEY = os.environ["SERVICE_KEY"]
Expand Down Expand Up @@ -100,7 +101,7 @@ def get_jwt_token(
data = {"email": test_email, "password": test_password}

response = requests.post(url, headers=headers, json=data)
if response.status_code != 200:
if response.status_code != status.HTTP_200_OK:
pytest.fail(
f"Request for the JWT token failed with status code {response.status_code} expected 200",
False,
Expand Down

0 comments on commit 1211e69

Please sign in to comment.