#NEWLINE# @ patch ( 'olympia.addons.buttons.jingo.Environment.get_template' ) #NEWLINE# def get_button( self , t_mock , is_mobile = False , **kwargs ) : #NEWLINE# #INDENT# 'Proxy for calling install_button.' #NEWLINE# template_mock = Mock ( ) #NEWLINE# t_mock . return_value = template_mock #NEWLINE# if is_mobile : #NEWLINE# #INDENT# mobile_install_button ( self . context , self . addon , ** kwargs ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# install_button ( t_mock . context , self . addon , ** kwargs ) #NEWLINE# #UNINDENT# return template_mock . render . call_args [ 0 ] [ 0 ] [ 'button' ]