summaryrefslogtreecommitdiff
path: root/tests/backends/sqlite/test_creation.py
diff options
context:
space:
mode:
authordjango-bot <ops@djangoproject.com>2022-02-03 20:24:19 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-02-07 20:37:05 +0100
commit9c19aff7c7561e3a82978a272ecdaad40dda5c00 (patch)
treef0506b668a013d0063e5fba3dbf4863b466713ba /tests/backends/sqlite/test_creation.py
parentf68fa8b45dfac545cfc4111d4e52804c86db68d3 (diff)
Refs #33476 -- Reformatted code with Black.
Diffstat (limited to 'tests/backends/sqlite/test_creation.py')
-rw-r--r--tests/backends/sqlite/test_creation.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/tests/backends/sqlite/test_creation.py b/tests/backends/sqlite/test_creation.py
index 6ec4262f73..ab1640c04e 100644
--- a/tests/backends/sqlite/test_creation.py
+++ b/tests/backends/sqlite/test_creation.py
@@ -5,15 +5,17 @@ from django.db import DEFAULT_DB_ALIAS, connection, connections
from django.test import SimpleTestCase
-@unittest.skipUnless(connection.vendor == 'sqlite', 'SQLite tests')
+@unittest.skipUnless(connection.vendor == "sqlite", "SQLite tests")
class TestDbSignatureTests(SimpleTestCase):
def test_custom_test_name(self):
test_connection = copy.copy(connections[DEFAULT_DB_ALIAS])
- test_connection.settings_dict = copy.deepcopy(connections[DEFAULT_DB_ALIAS].settings_dict)
- test_connection.settings_dict['NAME'] = None
- test_connection.settings_dict['TEST']['NAME'] = 'custom.sqlite.db'
+ test_connection.settings_dict = copy.deepcopy(
+ connections[DEFAULT_DB_ALIAS].settings_dict
+ )
+ test_connection.settings_dict["NAME"] = None
+ test_connection.settings_dict["TEST"]["NAME"] = "custom.sqlite.db"
signature = test_connection.creation_class(test_connection).test_db_signature()
- self.assertEqual(signature, (None, 'custom.sqlite.db'))
+ self.assertEqual(signature, (None, "custom.sqlite.db"))
def test_get_test_db_clone_settings_name(self):
test_connection = copy.copy(connections[DEFAULT_DB_ALIAS])
@@ -21,13 +23,13 @@ class TestDbSignatureTests(SimpleTestCase):
connections[DEFAULT_DB_ALIAS].settings_dict,
)
tests = [
- ('test.sqlite3', 'test_1.sqlite3'),
- ('test', 'test_1'),
+ ("test.sqlite3", "test_1.sqlite3"),
+ ("test", "test_1"),
]
for test_db_name, expected_clone_name in tests:
with self.subTest(test_db_name=test_db_name):
- test_connection.settings_dict['NAME'] = test_db_name
- test_connection.settings_dict['TEST']['NAME'] = test_db_name
+ test_connection.settings_dict["NAME"] = test_db_name
+ test_connection.settings_dict["TEST"]["NAME"] = test_db_name
creation_class = test_connection.creation_class(test_connection)
- clone_settings_dict = creation_class.get_test_db_clone_settings('1')
- self.assertEqual(clone_settings_dict['NAME'], expected_clone_name)
+ clone_settings_dict = creation_class.get_test_db_clone_settings("1")
+ self.assertEqual(clone_settings_dict["NAME"], expected_clone_name)