mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
python 3 updates
- Fix super() calls for python 3 - No need to inherit objects. - No need for u at the start of strings - Tidied up some brackets and f-strings too
This commit is contained in:
@@ -17,7 +17,7 @@ from flask_wtf.csrf import generate_csrf
|
||||
import config
|
||||
|
||||
|
||||
class RequestShim(object):
|
||||
class RequestShim():
|
||||
"""
|
||||
A fake request that proxies cookie-related methods to a Flask test client.
|
||||
"""
|
||||
@@ -44,14 +44,14 @@ class TestClient(testing.FlaskClient):
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.csrf_token = None
|
||||
self.app = None
|
||||
super(TestClient, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def setApp(self, _app):
|
||||
self.app = _app
|
||||
|
||||
def open(self, *args, **kwargs):
|
||||
if len(args) > 0 and isinstance(args[0], (EnvironBuilder, dict)):
|
||||
return super(TestClient, self).open(*args, **kwargs)
|
||||
return super().open(*args, **kwargs)
|
||||
|
||||
data = kwargs.get('data', {})
|
||||
|
||||
@@ -68,7 +68,7 @@ class TestClient(testing.FlaskClient):
|
||||
headers.extend(api_key_headers)
|
||||
kwargs['headers'] = headers
|
||||
|
||||
return super(TestClient, self).open(*args, **kwargs)
|
||||
return super().open(*args, **kwargs)
|
||||
|
||||
def fetch_csrf(self, res):
|
||||
m = re.search(
|
||||
|
||||
@@ -24,7 +24,7 @@ class SQLTemplateTestBase(BaseTestGenerator):
|
||||
]
|
||||
|
||||
def __init__(self):
|
||||
super(SQLTemplateTestBase, self).__init__()
|
||||
super().__init__()
|
||||
self.database_name = -1
|
||||
|
||||
def test_setup(self, connection, cursor):
|
||||
|
||||
@@ -1702,7 +1702,7 @@ def create_user(user_details):
|
||||
return user_id
|
||||
except Exception as exception:
|
||||
traceback.print_exc(file=sys.stderr)
|
||||
raise ("Error while creating server. %s" % exception)
|
||||
raise "Error while creating server. %s" % exception
|
||||
|
||||
|
||||
def get_test_user(self, user_details,
|
||||
|
||||
Reference in New Issue
Block a user