              self.assertIn(attribute, dir(view))
  
  
  @override_settings(ROOT_URLCONF='tests.test_viewsets')
  class ReverseActionTests(TestCase):
      def test_default_basename(self):
          view = ActionViewSet()
          view.basename = router.get_default_base_name(ActionViewSet)
 
</s> remove             @detail_route(methods=['post'], permission_classes=[permissions.AllowAny])
 </s> add             @action(methods=['post'], detail=True, permission_classes=[permissions.AllowAny]) </s> remove     @list_route(url_path='list/(?P<kwarg>[0-9]{4})')
 </s> add     @action(detail=False, url_path='list/(?P<kwarg>[0-9]{4})') </s> remove         @detail_route(methods=['options', 'get'])
 </s> add         @action(methods=['options', 'get'], detail=True)
class GetExtraActionTests(TestCase):

    def test_extra_actions(self):
        view = ActionViewSet()
        actual = [action.__name__ for action in view.get_extra_actions()]
        expected = ['custom_detail_action', 'custom_list_action', 'detail_action', 'list_action']

        self.assertEqual(actual, expected)


              self.assertIn(attribute, dir(view))
  
  
class GetExtraActionTests(TestCase):

    def test_extra_actions(self):
        view = ActionViewSet()
        actual = [action.__name__ for action in view.get_extra_actions()]
        expected = ['custom_detail_action', 'custom_list_action', 'detail_action', 'list_action']

        self.assertEqual(actual, expected)


  @override_settings(ROOT_URLCONF='tests.test_viewsets')
  class ReverseActionTests(TestCase):
      def test_default_basename(self):
          view = ActionViewSet()
          view.basename = router.get_default_base_name(ActionViewSet)
keep keep add keep keep keep keep keep
 Rework dynamic list/detail actions (#5705)

* Merge list/detail route decorators into 'action'

* Merge dynamic routes, add 'detail' attribute

* Add 'ViewSet.get_extra_actions()'

* Refactor dynamic route checking & collection

* Refactor dynamic route generation

* Add 'ViewSet.detail' initkwarg

* Fixup schema test

* Add release notes for dynamic action changes

* Replace list/detail route decorators in tests

* Convert tabs to spaces in router docs

* Update docs

* Make 'detail' a required argument of 'action'

* Improve router docs 
tests/test_viewsets.py