summaryrefslogtreecommitdiff
path: root/tests/backends
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2022-02-08 12:27:04 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-02-08 19:25:02 +0100
commit3278c31fa59b41d03aea167f4cf85f4ddf7f848d (patch)
tree0c80b4868391296335580242c8e65052a4f62a6b /tests/backends
parent6a682b38e75d4c975b4c4493565a59f1bc14397c (diff)
[4.0.x] Refs #33476 -- Refactored code to strictly match 88 characters line length.
Backport of 7119f40c9881666b6f9b5cf7df09ee1d21cc8344 from main.
Diffstat (limited to 'tests/backends')
-rw-r--r--tests/backends/mysql/tests.py3
-rw-r--r--tests/backends/oracle/tests.py6
-rw-r--r--tests/backends/test_utils.py5
-rw-r--r--tests/backends/tests.py12
4 files changed, 18 insertions, 8 deletions
diff --git a/tests/backends/mysql/tests.py b/tests/backends/mysql/tests.py
index 6ea289e151..139b363bf4 100644
--- a/tests/backends/mysql/tests.py
+++ b/tests/backends/mysql/tests.py
@@ -40,7 +40,8 @@ class IsolationLevelTests(TestCase):
def get_isolation_level(connection):
with connection.cursor() as cursor:
cursor.execute(
- "SHOW VARIABLES WHERE variable_name IN ('transaction_isolation', 'tx_isolation')"
+ "SHOW VARIABLES "
+ "WHERE variable_name IN ('transaction_isolation', 'tx_isolation')"
)
return cursor.fetchone()[1].replace("-", " ")
diff --git a/tests/backends/oracle/tests.py b/tests/backends/oracle/tests.py
index 185488a5b8..d191d98066 100644
--- a/tests/backends/oracle/tests.py
+++ b/tests/backends/oracle/tests.py
@@ -86,9 +86,9 @@ class TransactionalTests(TransactionTestCase):
with self.assertRaisesMessage(
DatabaseError,
(
- 'The database did not return a new row id. Probably "ORA-1403: '
- 'no data found" was raised internally but was hidden by the '
- "Oracle OCI library (see https://code.djangoproject.com/ticket/28859)."
+ 'The database did not return a new row id. Probably "ORA-1403: no '
+ 'data found" was raised internally but was hidden by the Oracle '
+ "OCI library (see https://code.djangoproject.com/ticket/28859)."
),
):
Square.objects.create(root=2, square=4)
diff --git a/tests/backends/test_utils.py b/tests/backends/test_utils.py
index 1b830eaced..03d4b036fd 100644
--- a/tests/backends/test_utils.py
+++ b/tests/backends/test_utils.py
@@ -130,7 +130,10 @@ class CursorWrapperTests(TransactionTestCase):
@skipIfDBFeature("supports_callproc_kwargs")
def test_unsupported_callproc_kparams_raises_error(self):
- msg = "Keyword parameters for callproc are not supported on this database backend."
+ msg = (
+ "Keyword parameters for callproc are not supported on this database "
+ "backend."
+ )
with self.assertRaisesMessage(NotSupportedError, msg):
with connection.cursor() as cursor:
cursor.callproc("test_procedure", [], {"P_I": 1})
diff --git a/tests/backends/tests.py b/tests/backends/tests.py
index c6c79b4bf7..28e00a04ca 100644
--- a/tests/backends/tests.py
+++ b/tests/backends/tests.py
@@ -128,7 +128,10 @@ class LastExecutedQueryTest(TestCase):
class ParameterHandlingTest(TestCase):
def test_bad_parameter_count(self):
- "An executemany call with too many/not enough parameters will raise an exception (Refs #12612)"
+ """
+ An executemany call with too many/not enough parameters will raise an
+ exception.
+ """
with connection.cursor() as cursor:
query = "INSERT INTO %s (%s, %s) VALUES (%%s, %%s)" % (
connection.introspection.identifier_converter("backends_square"),
@@ -152,7 +155,7 @@ class LongNameTest(TransactionTestCase):
available_apps = ["backends"]
def test_sequence_name_length_limits_create(self):
- """Test creation of model with long name and long pk name doesn't error. Ref #8901"""
+ """Creation of model with long name and long pk name doesn't error."""
VeryLongModelNameZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ.objects.create()
def test_sequence_name_length_limits_m2m(self):
@@ -517,7 +520,10 @@ class BackendTestCase(TransactionTestCase):
cursor.execute("SELECT 3" + new_connection.features.bare_select_suffix)
cursor.execute("SELECT 4" + new_connection.features.bare_select_suffix)
- msg = "Limit for query logging exceeded, only the last 3 queries will be returned."
+ msg = (
+ "Limit for query logging exceeded, only the last 3 queries will be "
+ "returned."
+ )
with self.assertWarnsMessage(UserWarning, msg):
self.assertEqual(3, len(new_connection.queries))