diff --git a/tests/demo_project/someapp/api.py b/tests/demo_project/someapp/api.py index a9c98140..2e0686c7 100644 --- a/tests/demo_project/someapp/api.py +++ b/tests/demo_project/someapp/api.py @@ -12,13 +12,12 @@ class EventSchema(BaseModel): + model_config = dict(from_attributes=True) + title: str start_date: date end_date: date - class Config: - from_attributes = True - @router.post("/create", url_name="event-create-url-name") def create_event(request, event: EventSchema): diff --git a/tests/test_response.py b/tests/test_response.py index 688186e6..5504e51e 100644 --- a/tests/test_response.py +++ b/tests/test_response.py @@ -45,10 +45,11 @@ class UserModel(BaseModel): user_name: str # skipping password output to responses - class Config: - from_attributes = True - alias_generator = to_camel - populate_by_name = True + model_config = dict( + from_attributes=True, + alias_generator=to_camel, + populate_by_name=True, + ) @router.get("/check_model", response=UserModel)