#NEWLINE# @ patch ( 'urllib.urlencode' ) #NEWLINE# def test_render_strings_url_alt_kwargs( self , mockurlencode ) : #NEWLINE# #INDENT# node = FormatSTWImageNode ( "'url'" , "'alt'" , stwsize = 'lrg' ) #NEWLINE# results = [ 'alt' , 'url' ] #NEWLINE# def side_effect( * args , **kwargs ) : #NEWLINE# #INDENT# return results . pop ( ) #NEWLINE# #UNINDENT# node . _resolve = Mock ( side_effect = mockurlencode ) #NEWLINE# mockurlencode . return_value = 'kwarg=kwargvalue' #NEWLINE# self . assertEqual ( '<img src="http://images.shrinktheweb.com/xino.php?kwarg=kwargvalue&stwurl=url" alt="alt"/>' , node . render ( None ) )