From d20852f59ab62bcdc86557e8677ae7f2468b8e84 Mon Sep 17 00:00:00 2001 From: Suren Khorenyan Date: Sat, 30 Dec 2023 22:28:21 +0300 Subject: [PATCH] Bot API 7.0 tests for dispatcher handle update message_reaction --- tests/test_dispatcher/test_dispatcher.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/test_dispatcher/test_dispatcher.py b/tests/test_dispatcher/test_dispatcher.py index b85cfc98..b9dfc726 100644 --- a/tests/test_dispatcher/test_dispatcher.py +++ b/tests/test_dispatcher/test_dispatcher.py @@ -24,6 +24,7 @@ from aiogram.types import ( ChosenInlineResult, InlineQuery, Message, + MessageReactionUpdated, Poll, PollAnswer, PollOption, @@ -32,6 +33,7 @@ from aiogram.types import ( ShippingQuery, Update, User, + ReactionTypeCustomEmoji, ) from aiogram.types.error_event import ErrorEvent from tests.mocked_bot import MockedBot @@ -447,6 +449,22 @@ class TestDispatcher: True, True, ), + pytest.param( + "message_reaction", + Update( + update_id=42, + message_reaction=MessageReactionUpdated( + chat=Chat(id=-42, type="channel"), + message_id=12345, + user=User(id=42, is_bot=False, first_name="Test"), + date=datetime.datetime.now(), + old_reaction=[], + new_reaction=[ReactionTypeCustomEmoji(custom_emoji="qwerty")], + ), + ), + True, + True, + ), ], ) async def test_listen_update(