File size: 968 Bytes
65d68f5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 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"
|