#NEWLINE# def reverse( self , view_name = None , query_params = None , **kwargs ) : #NEWLINE# #INDENT# version = pytest . api_version #NEWLINE# if ( self . url_kwargs is not None ) : #NEWLINE# #INDENT# kwargs . setdefault ( 'kwargs' , self . url_kwargs ) #NEWLINE# #UNINDENT# if ( not view_name ) : #NEWLINE# #INDENT# view_name = self . view_name #NEWLINE# #UNINDENT# url = reverse ( view_name , ** kwargs ) #NEWLINE# if query_params : #NEWLINE# #INDENT# for ( param , value ) in query_params . items ( ) : #NEWLINE# #INDENT# if isinstance ( version , list ) : #NEWLINE# #INDENT# query_params [ param ] = ',' . join ( map ( str , value ) ) #NEWLINE# #UNINDENT# #UNINDENT# url += ( '?' + urllib . parse . urlencode ( query_params ) ) #NEWLINE# #UNINDENT# return url