- 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.
18 lines
480 B
Python
18 lines
480 B
Python
"""User schemas."""
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class UserUpdate(BaseModel):
|
|
"""Schema for updating a user."""
|
|
|
|
name: str | None = Field(
|
|
None,
|
|
min_length=1,
|
|
max_length=100,
|
|
description="User full name",
|
|
)
|
|
plan_id: int | None = Field(None, description="User plan ID")
|
|
credits: int | None = Field(None, ge=0, description="User credits")
|
|
is_active: bool | None = Field(None, description="Whether user is active")
|