Refactor user endpoint tests to include pagination and response structure validation
- Updated tests for listing users to validate pagination and response format. - Changed mock return values to include total count and pagination details. - Refactored user creation mocks for clarity and consistency. - Enhanced assertions to check for presence of pagination fields in responses. - Adjusted test cases for user retrieval and updates to ensure proper handling of user data. - Improved readability by restructuring mock definitions and assertions across various test files.
This commit is contained in:
@@ -85,7 +85,8 @@ class ChangePasswordRequest(BaseModel):
|
||||
"""Schema for password change request."""
|
||||
|
||||
current_password: str | None = Field(
|
||||
None, description="Current password (required if user has existing password)",
|
||||
None,
|
||||
description="Current password (required if user has existing password)",
|
||||
)
|
||||
new_password: str = Field(
|
||||
...,
|
||||
@@ -98,5 +99,8 @@ class UpdateProfileRequest(BaseModel):
|
||||
"""Schema for profile update request."""
|
||||
|
||||
name: str | None = Field(
|
||||
None, min_length=1, max_length=100, description="User display name",
|
||||
None,
|
||||
min_length=1,
|
||||
max_length=100,
|
||||
description="User display name",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user