def test_dev_user_profile_update_survives_later_authenticated_requests(client): updated = client.patch( "/users/me", json={ "name": "Persistent student", "class_level": "SSLC / 10th", "syllabus": "Kerala State Board", "preferred_language": "English + Malayalam", }, ) assert updated.status_code == 200 assert updated.json()["name"] == "Persistent student" # Every endpoint resolves the same development identity again. The # profile must not be reset while that dependency is being evaluated. assert client.get("/learning-state/me").status_code == 200 profile = client.get("/users/me") assert profile.status_code == 200 body = profile.json() assert body["name"] == "Persistent student" assert body["class_level"] == "SSLC / 10th" assert body["syllabus"] == "Kerala State Board" assert body["preferred_language"] == "English + Malayalam"