diff --git a/frappe/integrations/oauth2.py b/frappe/integrations/oauth2.py index 29fd5caa83..5f0393e008 100644 --- a/frappe/integrations/oauth2.py +++ b/frappe/integrations/oauth2.py @@ -253,5 +253,5 @@ def introspect_token(token=None, token_type_hint=None): frappe.local.response = token_response - except Exception as e: + except Exception: frappe.local.response = frappe._dict({"active": False}) diff --git a/frappe/tests/test_oauth20.py b/frappe/tests/test_oauth20.py index 58ca911934..8e383403ce 100644 --- a/frappe/tests/test_oauth20.py +++ b/frappe/tests/test_oauth20.py @@ -2,10 +2,14 @@ # MIT License. See license.txt from __future__ import unicode_literals -import unittest, frappe, requests, time, jwt -from frappe.test_runner import make_test_records +import unittest +import requests +import jwt from six.moves.urllib.parse import urlparse, parse_qs, urljoin from urllib.parse import urlencode, quote + +import frappe +from frappe.test_runner import make_test_records from frappe.integrations.oauth2 import encode_params class TestOAuth20(unittest.TestCase): @@ -34,7 +38,7 @@ class TestOAuth20(unittest.TestCase): self.assertFalse(check_valid_openid_response()) def test_login_using_authorization_code(self): - client = update_client_for_auth_code_grant(self.client_id) + update_client_for_auth_code_grant(self.client_id) session = requests.Session() login(session) @@ -84,7 +88,7 @@ class TestOAuth20(unittest.TestCase): self.assertTrue(check_valid_openid_response(bearer_token.get("access_token"))) def test_login_using_authorization_code_with_pkce(self): - client = update_client_for_auth_code_grant(self.client_id) + update_client_for_auth_code_grant(self.client_id) session = requests.Session() login(session)