Skip to content

Commit ae0d32e

Browse files
committed
tests user schemas refactoring
1 parent 28b0200 commit ae0d32e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tests/schemas/user.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@
2020

2121

2222
class UserAttributesBaseSchema(BaseModel):
23+
model_config = ConfigDict(from_attributes=True)
24+
2325
name: str
2426
age: int | None = None
2527
email: str | None = None
26-
model_config = ConfigDict(from_attributes=True)
2728

2829

2930
class UserBaseSchema(UserAttributesBaseSchema):
@@ -73,11 +74,9 @@ class UserInSchemaAllowIdOnPost(UserBaseSchema):
7374
id: Annotated[str, ClientCanSetId()]
7475

7576

76-
class UserSchema(UserInSchema):
77+
class UserSchema(UserBaseSchema):
7778
"""User item schema."""
7879

79-
model_config = ConfigDict(from_attributes=True)
80-
8180
id: int
8281

8382

0 commit comments

Comments
 (0)