aiogram/tests/test_handler/test_poll.py
Alex Root Junior 9f49c0413f
Added full support for the Bot API 9.6 (#1792)
* Added full support for the Bot API 9.6

* Add support for `managed_bot` updates

* Set `description_parse_mode` default to `"parse_mode"` and use `DateTime` for `addition_date` in `PollOption`

* Update changelog with features and changes from Bot API 9.6

* Add changelog fragment generator and update poll parameter descriptions
2026-04-04 01:22:08 +03:00

30 lines
889 B
Python

from typing import Any
from aiogram.handlers import PollHandler
from aiogram.types import Poll, PollOption
class TestShippingQueryHandler:
async def test_attributes_aliases(self):
event = Poll(
id="query",
question="Q?",
options=[PollOption(persistent_id="1", text="A1", voter_count=1)],
is_closed=True,
is_anonymous=False,
type="quiz",
allows_multiple_answers=False,
allows_revoting=False,
total_voter_count=0,
correct_option_id=0,
)
class MyHandler(PollHandler):
async def handle(self) -> Any:
assert self.event == event
assert self.question == self.event.question
assert self.options == self.event.options
return True
assert await MyHandler(event)