mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 10:11:52 +00:00
* fix #660 prepare parse mode for input_message_content of InlineQueryResult * remove redundant get * black lint * add towncrier patch note
This commit is contained in:
parent
7cb0ac1ee2
commit
71eb5fc44e
3 changed files with 29 additions and 2 deletions
|
|
@ -2,7 +2,7 @@ import pytest
|
|||
|
||||
from aiogram import Bot
|
||||
from aiogram.methods import AnswerInlineQuery, Request
|
||||
from aiogram.types import InlineQueryResult, InlineQueryResultPhoto
|
||||
from aiogram.types import InlineQueryResult, InlineQueryResultPhoto, InputTextMessageContent
|
||||
from tests.mocked_bot import MockedBot
|
||||
|
||||
pytestmark = pytest.mark.asyncio
|
||||
|
|
@ -40,3 +40,22 @@ class TestAnswerInlineQuery:
|
|||
new_bot = Bot(token="42:TEST", parse_mode="HTML")
|
||||
request = query.build_request(new_bot)
|
||||
assert request.data["results"][0]["parse_mode"] == "HTML"
|
||||
|
||||
def test_parse_mode_input_message_content(self, bot: MockedBot):
|
||||
query = AnswerInlineQuery(
|
||||
inline_query_id="query id",
|
||||
results=[
|
||||
InlineQueryResultPhoto(
|
||||
id="result id",
|
||||
photo_url="photo",
|
||||
thumb_url="thumb",
|
||||
input_message_content=InputTextMessageContent(message_text="test"),
|
||||
)
|
||||
],
|
||||
)
|
||||
request = query.build_request(bot)
|
||||
assert request.data["results"][0]["input_message_content"]["parse_mode"] is None
|
||||
|
||||
new_bot = Bot(token="42:TEST", parse_mode="HTML")
|
||||
request = query.build_request(new_bot)
|
||||
assert request.data["results"][0]["input_message_content"]["parse_mode"] == "HTML"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue