def setUp(self):
with mock.patch("telegram.bot.Bot.set_webhook", callable=mock.MagicMock()):
with mock.patch("kik.api.KikApi.set_configuration", callable=mock.MagicMock()):
with mock.patch("messengerbot.MessengerClient.subscribe_app", callable=mock.MagicMock()):
with mock.patch("telegram.bot.Bot.get_me", callable=mock.MagicMock()) as mock_get_me:
user_dict = {'username': u'Microbot_test_bot', 'first_name': u'Microbot_test', 'id': 204840063}
mock_get_me.return_value = User(**user_dict)
self.bot = factories.BotFactory()
self.telegram_webhook_url = reverse('permabots:telegrambot', kwargs={'hook_id': self.bot.telegram_bot.hook_id})
self.kik_webhook_url = reverse('permabots:kikbot', kwargs={'hook_id': self.bot.kik_bot.hook_id})
self.messenger_webhook_url = reverse('permabots:messengerbot', kwargs={'hook_id': self.bot.messenger_bot.hook_id})
self.telegram_update = factories.TelegramUpdateLibFactory()
self._create_kik_api_message()
self._create_messenger_api_message()
self.kwargs = {'content_type': 'application/json', }
评论列表
文章目录