mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
refactored message_dict to message_data in FakeTelegram
This commit is contained in:
parent
38a2309c32
commit
a5f9373381
3 changed files with 47 additions and 45 deletions
|
|
@ -6,9 +6,11 @@ TOKEN = '123456789:AABBCCDDEEFFaabbccddeeff-1234567890'
|
|||
|
||||
|
||||
class FakeTelegram(aresponses.ResponsesMockServer):
|
||||
def __init__(self, message_dict, bot=None, **kwargs):
|
||||
def __init__(self, message_data, bot=None, **kwargs):
|
||||
from aiogram.utils.payload import _normalize
|
||||
super().__init__(**kwargs)
|
||||
self._body, self._headers = self.parse_data(message_dict)
|
||||
message_data = _normalize(message_data)
|
||||
self._body, self._headers = self.parse_data(message_data)
|
||||
|
||||
if isinstance(bot, Bot):
|
||||
Bot.set_current(bot)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue