diff --git a/tests/test_middleware.py b/tests/test_middleware.py index cd8ff63f..66e0240f 100644 --- a/tests/test_middleware.py +++ b/tests/test_middleware.py @@ -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, @@ -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):