#NEWLINE# def test_enable_webhook( self ) : #NEWLINE# #INDENT# self . assertTrue ( self . bot . enabled ) #NEWLINE# with mock . patch ( 'telegram.bot.Bot.setWebhook' , callable = mock . MagicMock ( ) ) as mock_setwebhook : #NEWLINE# #INDENT# self . bot . save ( ) #NEWLINE# ( args , kwargs ) = mock_setwebhook . call_args #NEWLINE# self . assertEqual ( 1 , mock_setwebhook . call_count ) #NEWLINE# self . assertIn ( reverse ( 'telegrambot:webhook' , kwargs = { #NEWLINE# #INDENT# 'token' : self . bot . token , #NEWLINE# #UNINDENT# } ) , kwargs [ 'webhook_url' ] ) #NEWLINE# self . assertEqual ( None , kwargs [ 'certificate' ] )