Download tests/test_dev_auth_profile_persistence.py from asnannp/DocDoeAI: direct link, hf CLI and curl.
- Browser
- Download file 968 Bytes
-
https://huggingface.co/spaces/asnannp/DocDoeAI/resolve/main/tests/test_dev_auth_profile_persistence.py
- Command line
-
hf download hf://spaces/asnannp/DocDoeAI/tests/test_dev_auth_profile_persistence.py
-
curl -L -o test_dev_auth_profile_persistence.py https://huggingface.co/spaces/asnannp/DocDoeAI/resolve/main/tests/test_dev_auth_profile_persistence.py
968 Bytes
| 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" | |