From e2fe2d10006b1fe572964527343035b9e2cc9cc6 Mon Sep 17 00:00:00 2001 From: mongkok Date: Tue, 7 Nov 2017 02:47:05 +0530 Subject: [PATCH] Fix test middleware authenticate --- tests/test_middleware.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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):