Commit f0227430 by Alex Burgel

Rename router collection test case

parent 8d521c06
...@@ -216,7 +216,7 @@ class TestActionAppliedToExistingRoute(TestCase): ...@@ -216,7 +216,7 @@ class TestActionAppliedToExistingRoute(TestCase):
self.router.urls self.router.urls
class StaticAndDynamicViewSet(viewsets.ViewSet): class CollectionAndDynamicViewSet(viewsets.ViewSet):
def list(self, request, *args, **kwargs): def list(self, request, *args, **kwargs):
return Response({'method': 'list'}) return Response({'method': 'list'})
...@@ -237,12 +237,12 @@ class StaticAndDynamicViewSet(viewsets.ViewSet): ...@@ -237,12 +237,12 @@ class StaticAndDynamicViewSet(viewsets.ViewSet):
return Response({'method': 'link2'}) return Response({'method': 'link2'})
class TestStaticAndDynamicRouter(TestCase): class TestCollectionAndDynamicRouter(TestCase):
def setUp(self): def setUp(self):
self.router = SimpleRouter() self.router = SimpleRouter()
def test_link_and_action_decorator(self): def test_link_and_action_decorator(self):
routes = self.router.get_routes(StaticAndDynamicViewSet) routes = self.router.get_routes(CollectionAndDynamicViewSet)
decorator_routes = [r for r in routes if not (r.name.endswith('-list') or r.name.endswith('-detail'))] decorator_routes = [r for r in routes if not (r.name.endswith('-list') or r.name.endswith('-detail'))]
# Make sure all these endpoints exist and none have been clobbered # Make sure all these endpoints exist and none have been clobbered
for i, endpoint in enumerate(['collection_action', 'collection_link', 'dynamic_action', 'dynamic_link']): for i, endpoint in enumerate(['collection_action', 'collection_link', 'dynamic_action', 'dynamic_link']):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment