This pull request introduces new endpoints for managing user profile information in the API, along with corresponding unit tests to ensure functionality and error handling.
Adds new endpoints: Implements a GET endpoint at /users/{user_id}/profile for retrieving a user's profile information, and a PUT endpoint at the same URL for updating it. These changes utilize the Profile model for both operations, enhancing the API's capabilities to interact with user profiles directly.
Unit tests: Includes a new test file tests/test_profiles.py that covers scenarios such as successful retrieval and update of user profile information, handling of profile not found errors, and unauthorized access simulation. These tests aim to validate the correctness of the new endpoints under various conditions.
Related to #4
This pull request introduces new endpoints for managing user profile information in the API, along with corresponding unit tests to ensure functionality and error handling.
/users/{user_id}/profile
for retrieving a user's profile information, and a PUT endpoint at the same URL for updating it. These changes utilize theProfile
model for both operations, enhancing the API's capabilities to interact with user profiles directly.tests/test_profiles.py
that covers scenarios such as successful retrieval and update of user profile information, handling of profile not found errors, and unauthorized access simulation. These tests aim to validate the correctness of the new endpoints under various conditions.For more details, open the Copilot Workspace session.