add pytest case

This commit is contained in:
2024-12-06 17:21:47 +09:00
parent a6576827fd
commit 155cbd43e8
3 changed files with 78 additions and 37 deletions

View 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"]