Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions tests/test_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,23 @@ def test_get_profile(clean_store):
def test_get_nonexistent_profile(clean_store):
response = client.get("/profile/nobody")
assert response.status_code == 404


def test_delete_profile(clean_store):
# First create a profile
client.post(
"/profile",
json={"username": "charlie", "bio": "tester", "age": 30},
)
# Delete the profile
response = client.delete("/profile/charlie")
assert response.status_code == 200
assert response.json() == {"deleted": True}
# Verify it is actually gone
get_response = client.get("/profile/charlie")
assert get_response.status_code == 404


def test_delete_nonexistent_profile(clean_store):
response = client.delete("/profile/nobody")
assert response.status_code == 404