diff options
author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-04 08:08:27 +0100 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-07 20:37:05 +0100 |
commit | 7119f40c9881666b6f9b5cf7df09ee1d21cc8344 (patch) | |
tree | fa50869f5614295f462d9bf77fec59365c621609 /tests/backends | |
parent | 9c19aff7c7561e3a82978a272ecdaad40dda5c00 (diff) | |
download | django-7119f40c9881666b6f9b5cf7df09ee1d21cc8344.tar.gz |
Refs #33476 -- Refactored code to strictly match 88 characters line length.
Diffstat (limited to 'tests/backends')
-rw-r--r-- | tests/backends/mysql/tests.py | 3 | ||||
-rw-r--r-- | tests/backends/oracle/tests.py | 6 | ||||
-rw-r--r-- | tests/backends/test_utils.py | 5 | ||||
-rw-r--r-- | tests/backends/tests.py | 12 |
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 a518db2c64..3f51d57de8 100644 --- a/tests/backends/oracle/tests.py +++ b/tests/backends/oracle/tests.py @@ -80,9 +80,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)) |