Skip to content
This repository was archived by the owner on May 26, 2020. It is now read-only.

Commit 6b01b47

Browse files
authored
tests: fix MockView (#381)
It should use a string. Using a dict here results in the keys being used, but in an unpredictable order.
1 parent 5c81e65 commit 6b01b47

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tests/test_authentication.py

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ def test_post_form_passing_jwt_auth(self):
6262
'/jwt/', {'example': 'example'}, HTTP_AUTHORIZATION=auth)
6363

6464
self.assertEqual(response.status_code, status.HTTP_200_OK)
65+
self.assertEqual(response.content, b'mockview-post')
6566

6667
def test_post_json_passing_jwt_auth(self):
6768
"""

tests/urls.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ class MockView(APIView):
1818
permission_classes = (permissions.IsAuthenticated,)
1919

2020
def get(self, request):
21-
return HttpResponse({'a': 1, 'b': 2, 'c': 3})
21+
return HttpResponse('mockview-get')
2222

2323
def post(self, request):
24-
return HttpResponse({'a': 1, 'b': 2, 'c': 3})
24+
return HttpResponse('mockview-post')
2525

2626

2727
urlpatterns = [

0 commit comments

Comments
 (0)