Skip to content

Commit

Permalink
Fix test middleware authenticate
Browse files Browse the repository at this point in the history
  • Loading branch information
mongkok committed Nov 6, 2017
1 parent e2fac45 commit e2fe2d1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_authenticate(self):

self.get_response_mock.assert_called_once_with(request)

@patch('graphql_jwt.middleware.authenticate')
@patch('graphql_jwt.middleware.authenticate', return_value=None)
def test_user_not_authenticate(self, *args):
headers = {
'HTTP_AUTHORIZATION': 'JWT ' + self.token,
Expand All @@ -51,9 +51,8 @@ def test_graphql_error(self):

def test_header_not_found(self):
request = self.factory.get('/')
response = self.middleware(request)
self.middleware(request)

self.assertTrue(dir(response))
self.get_response_mock.assert_called_once_with(request)

def test_user_is_authenticated(self):
Expand Down

0 comments on commit e2fe2d1

Please sign in to comment.