From f43c3877aff53c201a7e246bee123125ae6a236d Mon Sep 17 00:00:00 2001 From: Evgeniy Kulakov Date: Sun, 4 Jun 2023 00:48:16 +0300 Subject: [PATCH] fix: replaced avatar return type from BotXAPIAttachment to base64 string --- pybotx/client/users_api/update_user_profile.py | 2 +- tests/client/users_api/test_update_user_profile.py | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/pybotx/client/users_api/update_user_profile.py b/pybotx/client/users_api/update_user_profile.py index 510ec8ce..486d3fcb 100644 --- a/pybotx/client/users_api/update_user_profile.py +++ b/pybotx/client/users_api/update_user_profile.py @@ -47,7 +47,7 @@ def from_domain( user_huid=user_huid, name=name, public_name=public_name, - avatar=api_avatar, + avatar=getattr(api_avatar, 'data', Undefined), company=company, company_position=company_position, description=description, diff --git a/tests/client/users_api/test_update_user_profile.py b/tests/client/users_api/test_update_user_profile.py index 53e8e4d9..47eaf187 100644 --- a/tests/client/users_api/test_update_user_profile.py +++ b/tests/client/users_api/test_update_user_profile.py @@ -77,10 +77,7 @@ async def test__update_user_profile__maximum_update_succeed( f"https://{host}/api/v3/botx/users/update_profile", headers={"Authorization": "Bearer token", "Content-Type": "application/json"}, json={ - "avatar": { - "data": "data:image/png;base64,SGVsbG8sIHdvcmxkIQ==", - "file_name": "avatar.png", - }, + "avatar": "data:image/png;base64,SGVsbG8sIHdvcmxkIQ==", "company": "Doge Co", "company_position": "Chief", "department": "Commercy",