Fixed tests

This commit is contained in:
Alex Root Junior 2023-02-04 19:09:45 +02:00
parent ddb4da34fd
commit af0d791410
No known key found for this signature in database
GPG key ID: 074C1D455EBEA4AC
3 changed files with 14 additions and 6 deletions

View file

@ -9,6 +9,7 @@ class TestChatJoinRequest:
chat_join_request = ChatJoinRequest(
chat=Chat(id=-42, type="supergroup"),
from_user=User(id=42, is_bot=False, first_name="Test"),
user_chat_id=42,
date=datetime.datetime.now(),
)
@ -22,6 +23,7 @@ class TestChatJoinRequest:
chat_join_request = ChatJoinRequest(
chat=Chat(id=-42, type="supergroup"),
from_user=User(id=42, is_bot=False, first_name="Test"),
user_chat_id=42,
date=datetime.datetime.now(),
)

View file

@ -434,8 +434,9 @@ class TestDispatcher:
Update(
update_id=42,
chat_join_request=ChatJoinRequest(
chat=Chat(id=42, type="private"),
chat=Chat(id=-42, type="private"),
from_user=User(id=42, is_bot=False, first_name="Test"),
user_chat_id=42,
date=datetime.datetime.now(),
),
),
@ -589,8 +590,7 @@ class TestDispatcher:
"aiogram.dispatcher.dispatcher.Dispatcher.silent_call_request",
new_callable=AsyncMock,
) as mocked_silent_call_request:
result = await dispatcher._process_update(bot=bot, update=Update(update_id=42))
print(result)
await dispatcher._process_update(bot=bot, update=Update(update_id=42))
mocked_silent_call_request.assert_awaited()
async def test_process_update_exception(self, bot: MockedBot, caplog):

View file

@ -315,7 +315,8 @@ class TestChatMemberUpdatedStatusFilter:
update = {
"user": user,
"until_date": datetime.now(),
"is_anonymous": False,
"is_anonymous": True,
"custom_title": True,
"can_be_edited": True,
"can_manage_chat": True,
"can_delete_messages": True,
@ -327,12 +328,17 @@ class TestChatMemberUpdatedStatusFilter:
"can_post_messages": True,
"can_edit_messages": True,
"can_pin_messages": True,
"can_manage_topics": True,
"can_send_messages": True,
"can_send_media_messages": True,
"can_send_audios": True,
"can_send_documents": True,
"can_send_photos": True,
"can_send_videos": True,
"can_send_video_notes": True,
"can_send_voice_notes": True,
"can_send_polls": True,
"can_send_other_messages": True,
"can_add_web_page_previews": True,
"can_manage_topics": True,
}
event = ChatMemberUpdated(
chat=Chat(id=42, type="test"),