@@ -261,11 +261,11 @@ def list_route_get(self, request, *args, **kwargs):
261
261
def detail_route_get (self , request , * args , ** kwargs ):
262
262
return Response ({'method' : 'link2' })
263
263
264
- @list_route (custom_method_name = "list_custom-route" )
264
+ @list_route (url_path = "list_custom-route" )
265
265
def list_custom_route_get (self , request , * args , ** kwargs ):
266
266
return Response ({'method' : 'link1' })
267
267
268
- @detail_route (custom_method_name = "detail_custom-route" )
268
+ @detail_route (url_path = "detail_custom-route" )
269
269
def detail_custom_route_get (self , request , * args , ** kwargs ):
270
270
return Response ({'method' : 'link2' })
271
271
@@ -278,7 +278,7 @@ def test_list_and_detail_route_decorators(self):
278
278
routes = self .router .get_routes (DynamicListAndDetailViewSet )
279
279
decorator_routes = [r for r in routes if not (r .name .endswith ('-list' ) or r .name .endswith ('-detail' ))]
280
280
281
- MethodNamesMap = namedtuple ('MethodNamesMap' , 'method_name custom_method_name ' )
281
+ MethodNamesMap = namedtuple ('MethodNamesMap' , 'method_name url_path ' )
282
282
# Make sure all these endpoints exist and none have been clobbered
283
283
for i , endpoint in enumerate ([MethodNamesMap ('list_custom_route_get' , 'list_custom-route' ),
284
284
MethodNamesMap ('list_route_get' , 'list_route_get' ),
@@ -290,14 +290,14 @@ def test_list_and_detail_route_decorators(self):
290
290
route = decorator_routes [i ]
291
291
# check url listing
292
292
method_name = endpoint .method_name
293
- custom_method_name = endpoint .custom_method_name
293
+ url_path = endpoint .url_path
294
294
295
295
if method_name .startswith ('list_' ):
296
296
self .assertEqual (route .url ,
297
- '^{{prefix}}/{0}{{trailing_slash}}$' .format (custom_method_name ))
297
+ '^{{prefix}}/{0}{{trailing_slash}}$' .format (url_path ))
298
298
else :
299
299
self .assertEqual (route .url ,
300
- '^{{prefix}}/{{lookup}}/{0}{{trailing_slash}}$' .format (custom_method_name ))
300
+ '^{{prefix}}/{{lookup}}/{0}{{trailing_slash}}$' .format (url_path ))
301
301
# check method to function mapping
302
302
if method_name .endswith ('_post' ):
303
303
method_map = 'post'
0 commit comments