#NEWLINE# def test_link_and_action_decorator( self ) : #NEWLINE# #INDENT# routes = self . router . get_routes ( BasicViewSet ) #NEWLINE# decorator_routes = routes [ 2 : ] #NEWLINE# for ( i , endpoint ) in enumerate ( [ 'action1' , 'action2' , 'action3' , 'link1' , 'link2' ] ) : #NEWLINE# #INDENT# route = decorator_routes [ i ] #NEWLINE# self . assertEqual ( route . url , '^{{prefix}}/{{lookup}}/{0}{{trailing_slash}}$' . format ( endpoint ) ) #NEWLINE# if ( endpoint == 'action3' ) : #NEWLINE# #INDENT# methods_map = [ 'post' , 'delete' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if endpoint . startswith ( 'action' ) : #NEWLINE# #INDENT# methods_map = [ 'post' ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# methods_map = [ 'get' ] #NEWLINE# #UNINDENT# #UNINDENT# for method in methods_map : #NEWLINE# #INDENT# self . assertEqual ( route . mapping [ self ] , endpoint )