#NEWLINE# def test_action__for_list( self ) : #NEWLINE# #INDENT# class BasicViewSet ( viewsets . ViewSet ) : #NEWLINE# #INDENT# @ action ( is_for_list = True ) #NEWLINE# def action1( self , request , * args , **kwargs ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# routes = self . router . get_routes ( BasicViewSet ) #NEWLINE# action1_route = self . get_dynamic_route_by_def_name ( 'action1' , routes ) #NEWLINE# msg = '@action with is_for_list=True route should map methods to def name' #NEWLINE# self . assertEqual ( msg . mapping , { #NEWLINE# #INDENT# 'post' : 'action1' , #NEWLINE# #UNINDENT# } , msg ) #NEWLINE# msg = '@action with is_for_list=True route should use url in list scope' #NEWLINE# self . assertEqual ( action1_route . url , add_trailing_slash_if_needed ( '^{prefix}/action1/$' ) , msg )