From 36a74da4f48d72dc569fbfb32338c1bb82e5a53a Mon Sep 17 00:00:00 2001 From: Eldinnie Date: Sat, 23 Feb 2019 21:33:03 +0100 Subject: [PATCH] fix setting bot on ShippingQuery (#1355) * fix setting bot on ShippingQuery * Fix test to test de_json --- telegram/payment/shippingquery.py | 2 +- tests/test_shippingquery.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/telegram/payment/shippingquery.py b/telegram/payment/shippingquery.py index a5b819150..5f6178526 100644 --- a/telegram/payment/shippingquery.py +++ b/telegram/payment/shippingquery.py @@ -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:: diff --git a/tests/test_shippingquery.py b/tests/test_shippingquery.py index e92301020..d88bfa84e 100644 --- a/tests/test_shippingquery.py +++ b/tests/test_shippingquery.py @@ -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()