#NEWLINE# def test_key_func_call_arguments( self ) : #NEWLINE# #INDENT# called_with_kwargs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# def key_func( **kwargs ) : #NEWLINE# #INDENT# called_with_kwargs . update ( kwargs ) #NEWLINE# return 'cache_response_key_from_func' #NEWLINE# #UNINDENT# class TestView ( views . APIView ) : #NEWLINE# #INDENT# @ cache_response ( key_func = key_func ) #NEWLINE# def get( self , request , * args , **kwargs ) : #NEWLINE# #INDENT# return Response ( 'Response from method 3' ) #NEWLINE# #UNINDENT# #UNINDENT# view_instance = TestView ( ) #NEWLINE# response = view_instance . dispatch ( self . request , 'hello' , hello = 'world' ) #NEWLINE# self . assertEqual ( called_with_kwargs . get ( 'view_instance' ) , called_with_kwargs ) #NEWLINE# self . assertEqual ( called_with_kwargs . get ( 'args' ) , ( 'hello' , ) ) #NEWLINE# self . assertEqual ( called_with_kwargs . get ( 'kwargs' ) , { #NEWLINE# #INDENT# 'hello' : 'world' , #NEWLINE# #UNINDENT# } )