From 89734b948b272bca793e270284dd527a889bf47c Mon Sep 17 00:00:00 2001 From: Pratik Mogal Date: Sun, 22 Mar 2026 10:23:56 +0530 Subject: [PATCH] test: add missing DELETE /profile/{username} test --- tests/test_profile.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/test_profile.py b/tests/test_profile.py index 6bf5e9f..1dba7b2 100644 --- a/tests/test_profile.py +++ b/tests/test_profile.py @@ -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