PDF-Assit_RAG / backend /tests /test_profile.py
Param20h's picture
deploy: pure backend API with keywords fix
7c46845 unverified
Raw
History Blame Contribute Delete
883 Bytes
def test_profile_update_duplicate_username(client, auth_headers, other_user):
response = client.put(
"/profile/",
json={"username": "other"},
headers=auth_headers,
)
assert response.status_code == 400
assert response.json()["error"]["message"] == "Username already exists"
def test_profile_update_keep_username(client, auth_headers, user):
response = client.put(
"/profile/",
json={"username": "tester"},
headers=auth_headers,
)
assert response.status_code == 200
assert response.json()["username"] == "tester"
def test_profile_update_unique_username(client, auth_headers, user):
response = client.put(
"/profile/",
json={"username": "tester_new"},
headers=auth_headers,
)
assert response.status_code == 200
assert response.json()["username"] == "tester_new"