add pytest case
This commit is contained in:
8
backend/app/tests/test_auth.py
Normal file
8
backend/app/tests/test_auth.py
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
def test_usr_login(test_client,test_user):
|
||||
response = test_client.post("/api/token", data={"username": test_user["email"], "password": test_user["password"]})
|
||||
assert response.status_code == 200
|
||||
assert "access_token" in response.json()
|
||||
assert "token_type" in response.json()
|
||||
assert response.json()["user_name"] == test_user["first_name"]+ " " + test_user["last_name"]
|
||||
|
||||
Reference in New Issue
Block a user