From 8393f64120e033b5509c1361de57e2de27ea90cc Mon Sep 17 00:00:00 2001 From: palash Date: Fri, 10 Jul 2020 14:03:52 +0530 Subject: [PATCH] test_auth_backends: Remove mock.patch('logging.warning'). Removed mock.patch('logging.warning') as no logs were being generated in these blocks. --- zerver/tests/test_auth_backends.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/zerver/tests/test_auth_backends.py b/zerver/tests/test_auth_backends.py index 3f01d7a729..e12b0c1a08 100644 --- a/zerver/tests/test_auth_backends.py +++ b/zerver/tests/test_auth_backends.py @@ -3966,8 +3966,7 @@ class TestJWTLogin(ZulipTestCase): def test_login_failure_due_to_wrong_subdomain(self) -> None: payload = {'user': 'hamlet', 'realm': 'zulip.com'} with self.settings(JWT_AUTH_KEYS={'acme': {'key': 'key', 'algorithms': ['HS256']}}): - with mock.patch('zerver.views.auth.get_subdomain', return_value='acme'), \ - mock.patch('logging.warning'): + with mock.patch('zerver.views.auth.get_subdomain', return_value='acme'): key = settings.JWT_AUTH_KEYS['acme']['key'] [algorithm] = settings.JWT_AUTH_KEYS['acme']['algorithms'] web_token = jwt.encode(payload, key, algorithm).decode('utf8') @@ -3980,8 +3979,7 @@ class TestJWTLogin(ZulipTestCase): def test_login_failure_due_to_empty_subdomain(self) -> None: payload = {'user': 'hamlet', 'realm': 'zulip.com'} with self.settings(JWT_AUTH_KEYS={'': {'key': 'key', 'algorithms': ['HS256']}}): - with mock.patch('zerver.views.auth.get_subdomain', return_value=''), \ - mock.patch('logging.warning'): + with mock.patch('zerver.views.auth.get_subdomain', return_value=''): key = settings.JWT_AUTH_KEYS['']['key'] [algorithm] = settings.JWT_AUTH_KEYS['']['algorithms'] web_token = jwt.encode(payload, key, algorithm).decode('utf8')