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

Commit

Permalink
tests: fix MockView (#381)
Browse files Browse the repository at this point in the history
It should use a string.
Using a dict here results in the keys being used, but in an
unpredictable order.
  • Loading branch information
blueyed committed Sep 22, 2017
1 parent 5c81e65 commit 6b01b47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions tests/test_authentication.py
Expand Up @@ -62,6 +62,7 @@ def test_post_form_passing_jwt_auth(self):
'/jwt/', {'example': 'example'}, HTTP_AUTHORIZATION=auth)

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

def test_post_json_passing_jwt_auth(self):
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/urls.py
Expand Up @@ -18,10 +18,10 @@ class MockView(APIView):
permission_classes = (permissions.IsAuthenticated,)

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

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


urlpatterns = [
Expand Down

0 comments on commit 6b01b47

Please sign in to comment.