mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-25 16:46:35 +01:00
fix setting bot on ShippingQuery (#1355)
* fix setting bot on ShippingQuery * Fix test to test de_json
This commit is contained in:
parent
0c10c537f7
commit
36a74da4f4
2 changed files with 2 additions and 1 deletions
|
@ -64,7 +64,7 @@ class ShippingQuery(TelegramObject):
|
|||
data['from_user'] = User.de_json(data.pop('from'), bot)
|
||||
data['shipping_address'] = ShippingAddress.de_json(data.get('shipping_address'), bot)
|
||||
|
||||
return cls(**data)
|
||||
return cls(bot=bot, **data)
|
||||
|
||||
def answer(self, *args, **kwargs):
|
||||
"""Shortcut for::
|
||||
|
|
|
@ -50,6 +50,7 @@ class TestShippingQuery(object):
|
|||
assert shipping_query.invoice_payload == self.invoice_payload
|
||||
assert shipping_query.from_user == self.from_user
|
||||
assert shipping_query.shipping_address == self.shipping_address
|
||||
assert shipping_query.bot == bot
|
||||
|
||||
def test_to_dict(self, shipping_query):
|
||||
shipping_query_dict = shipping_query.to_dict()
|
||||
|
|
Loading…
Reference in a new issue