mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 00:49:49 +03:00
Add failing test++
This commit is contained in:
parent
12918fa541
commit
382e3322f1
|
@ -81,10 +81,21 @@ class ActionNamesViewSet(GenericViewSet):
|
|||
raise NotImplementedError
|
||||
|
||||
|
||||
class ThingWithMapping:
|
||||
def __init__(self):
|
||||
self.mapping = {}
|
||||
|
||||
|
||||
class ActionViewSetWithMapping(ActionViewSet):
|
||||
mapper = ThingWithMapping()
|
||||
|
||||
|
||||
|
||||
router = SimpleRouter()
|
||||
router.register(r'actions', ActionViewSet)
|
||||
router.register(r'actions-alt', ActionViewSet, basename='actions-alt')
|
||||
router.register(r'names', ActionNamesViewSet, basename='names')
|
||||
router.register(r'mapping', ActionViewSetWithMapping, basename='mapping')
|
||||
|
||||
|
||||
urlpatterns = [
|
||||
|
@ -145,16 +156,6 @@ class InitializeViewSetsTestCase(TestCase):
|
|||
self.assertNotIn(attribute, dir(bare_view))
|
||||
self.assertIn(attribute, dir(view))
|
||||
|
||||
|
||||
class ThingWithMapping:
|
||||
def __init__(self):
|
||||
self.mapping = {}
|
||||
|
||||
|
||||
class ActionViewSetWithMapping(ActionViewSet):
|
||||
mapper = ThingWithMapping()
|
||||
|
||||
|
||||
class GetExtraActionsTests(TestCase):
|
||||
|
||||
def test_extra_actions(self):
|
||||
|
|
Loading…
Reference in New Issue
Block a user