mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-12 10:11:52 +00:00
Add ShippingQuery.answer
This commit is contained in:
parent
cf12da0c4a
commit
83730276bc
4 changed files with 64 additions and 1 deletions
24
tests/test_api/test_types/test_shipping_query.py
Normal file
24
tests/test_api/test_types/test_shipping_query.py
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
from aiogram.api.methods import AnswerShippingQuery
|
||||
from aiogram.api.types import ShippingAddress, ShippingQuery, User
|
||||
|
||||
|
||||
class TestInlineQuery:
|
||||
def test_answer_alias(self):
|
||||
shipping_query = ShippingQuery(
|
||||
id="id",
|
||||
from_user=User(id=42, is_bot=False, first_name="name"),
|
||||
invoice_payload="payload",
|
||||
shipping_address=ShippingAddress(
|
||||
country_code="foo",
|
||||
state="foo",
|
||||
city="foo",
|
||||
street_line1="foo",
|
||||
street_line2="foo",
|
||||
post_code="foo",
|
||||
),
|
||||
)
|
||||
|
||||
api_method = shipping_query.answer(True)
|
||||
|
||||
assert isinstance(api_method, AnswerShippingQuery)
|
||||
assert api_method.shipping_query_id == shipping_query.id
|
||||
Loading…
Add table
Add a link
Reference in a new issue