File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
src/simcore_service_api_server/services Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -265,14 +265,15 @@ async def get_me(self) -> Profile:
265265 @_exception_mapper (_PROFILE_STATUS_MAP )
266266 async def update_me (self , * , profile_update : ProfileUpdate ) -> Profile :
267267
268- update = WebProfileUpdate (
268+ update = WebProfileUpdate .model_construct (
269+ _fields_set = profile_update .model_fields_set ,
269270 first_name = profile_update .first_name ,
270271 last_name = profile_update .last_name ,
271272 )
272273
273274 response = await self .client .patch (
274275 "/me" ,
275- json = update .model_dump (exclude_none = True , exclude_unset = True ),
276+ json = update .model_dump (exclude_unset = True ),
276277 cookies = self .session_cookies ,
277278 )
278279 response .raise_for_status ()
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ def mocked_webserver_service_api(app: FastAPI):
3232 ) as respx_mock :
3333 # NOTE: webserver-api uses the same schema as api-server!
3434 # in-memory fake data
35- me = WebProfileGet .model_json_schema ()["examples" ][0 ]
35+ me : dict = WebProfileGet .model_json_schema ()["examples" ][0 ]
36+ me ["first_name" ] = "James"
37+ me ["last_name" ] = "Maxwell"
3638
3739 def _get_me (request ):
3840 return httpx .Response (status .HTTP_200_OK , json = {"data" : me })
@@ -43,12 +45,10 @@ def _update_me(request: httpx.Request):
4345 return httpx .Response (status .HTTP_200_OK , json = {"data" : me })
4446
4547 respx_mock .get ("/me" , name = "get_me" ).mock (side_effect = _get_me )
46- respx_mock .put ("/me" , name = "update_me" ).mock (side_effect = _update_me )
48+ respx_mock .patch ("/me" , name = "update_me" ).mock (side_effect = _update_me )
4749
4850 yield respx_mock
4951
50- del me
51-
5252
5353async def test_get_profile (
5454 client : httpx .AsyncClient ,
You can’t perform that action at this time.
0 commit comments