From 382e3322f105ce50674b4836bfb730ac6945462c Mon Sep 17 00:00:00 2001 From: Ricardo Busquet Date: Thu, 5 Mar 2020 00:37:18 -0500 Subject: [PATCH] Add failing test++ --- tests/test_viewsets.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/test_viewsets.py b/tests/test_viewsets.py index 2399db4f4..fc62cc981 100644 --- a/tests/test_viewsets.py +++ b/tests/test_viewsets.py @@ -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):