aboutsummaryrefslogtreecommitdiffstats
path: root/tests/browsable_api/views.py
diff options
context:
space:
mode:
authorTom Christie2014-09-05 09:07:14 +0100
committerTom Christie2014-09-05 09:07:14 +0100
commit2e632e5af221e8f9a29ce03f817013f79172b687 (patch)
treeb17df634e30017cf41720e969c4dabe81ebd25b5 /tests/browsable_api/views.py
parent29bcce70135d9fccd8d27a5e425f756363e28700 (diff)
parentef1fb3d8df8227961e3b24d1955af93be13519ea (diff)
downloaddjango-rest-framework-2e632e5af221e8f9a29ce03f817013f79172b687.tar.bz2
Merge pull request #1820 from carltongibson/login-dropdown
Hide login link in browsable API if the login view is not registered.
Diffstat (limited to 'tests/browsable_api/views.py')
-rw-r--r--tests/browsable_api/views.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/browsable_api/views.py b/tests/browsable_api/views.py
new file mode 100644
index 00000000..000f4e80
--- /dev/null
+++ b/tests/browsable_api/views.py
@@ -0,0 +1,15 @@
+from __future__ import unicode_literals
+
+from rest_framework.views import APIView
+from rest_framework import authentication
+from rest_framework import renderers
+from rest_framework.response import Response
+
+
+class MockView(APIView):
+
+ authentication_classes = (authentication.SessionAuthentication,)
+ renderer_classes = (renderers.BrowsableAPIRenderer,)
+
+ def get(self, request):
+ return Response({'a': 1, 'b': 2, 'c': 3})