Change the following to replace Python 2 code with Python 3:

1) Replace the deprecated unit test method.
2) Wraps filter usage in a list call.
3) Converts the old metaclass syntax to new.
4) Use range instead of xrange method.
5) Change Unicode to str.
6) Several other transformations.
7) Fixed change password test cases.
8) Use simplejson instead of plain JSON.
This commit is contained in:
Cyril Jouve
2020-08-31 16:45:31 +05:30
committed by Akshay Joshi
parent 11d5613866
commit 5a253f9053
385 changed files with 938 additions and 944 deletions
+2 -2
View File
@@ -169,7 +169,7 @@ class SQLFilter(object):
self.did = kwargs['did']
self.obj_id = kwargs['obj_id']
sql_filter = kwargs.get('sql_filter', None)
self._row_filter = sql_filter if type(sql_filter) is str else None
self._row_filter = sql_filter if isinstance(sql_filter, str) else None
self._data_sorting = kwargs.get('data_sorting', None)
self._set_sorting_from_filter_dialog = False
@@ -212,7 +212,7 @@ class SQLFilter(object):
Args:
row_filter: sql query
"""
if type(row_filter) is not str:
if not isinstance(row_filter, str):
row_filter = None
status, msg = self.validate_filter(row_filter)