@@ -87,7 +87,11 @@ def test_post_user(self):
8787
8888 with self ._create_test_client (router = demo_pydantic_router ) as test_client :
8989 response : Response = test_client .post (
90- "/post_user" , content = pydantic_data .model_dump_json ()
90+ "/post_user" ,
91+ headers = {
92+ "Content-Type" : "application/json" ,
93+ },
94+ content = pydantic_data .model_dump_json (),
9195 )
9296 self .assertEqual (response .status_code , 200 )
9397 res = response .json ()
@@ -115,7 +119,11 @@ def test_post_private_user(self):
115119
116120 with self ._create_test_client (router = demo_pydantic_router ) as test_client :
117121 response : Response = test_client .post (
118- "/post_private_user" , content = pydantic_data .model_dump_json ()
122+ "/post_private_user" ,
123+ headers = {
124+ "Content-Type" : "application/json" ,
125+ },
126+ content = pydantic_data .model_dump_json (),
119127 )
120128 self .assertEqual (response .status_code , 200 )
121129 user = response .json ()
@@ -143,7 +151,11 @@ def test_post_private_user_generic(self):
143151
144152 with self ._create_test_client (router = demo_pydantic_router ) as test_client :
145153 response : Response = test_client .post (
146- "/post_private_user_generic" , content = pydantic_data .model_dump_json ()
154+ "/post_private_user_generic" ,
155+ headers = {
156+ "Content-Type" : "application/json" ,
157+ },
158+ content = pydantic_data .model_dump_json (),
147159 )
148160 self .assertEqual (response .status_code , 200 )
149161 res = response .json ()
@@ -204,5 +216,9 @@ def test_extra_forbid_response_fails(self):
204216 router = demo_pydantic_router
205217 ) as test_client :
206218 test_client .post (
207- "/post_private_customer" , content = pydantic_data .model_dump_json ()
219+ "/post_private_customer" ,
220+ headers = {
221+ "Content-Type" : "application/json" ,
222+ },
223+ content = pydantic_data .model_dump_json (),
208224 )
0 commit comments