mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Refs #23968 -- Removed unnecessary lists, generators, and tuple calls.
This commit is contained in:
parent
edee5a8de6
commit
2c69824e5a
63 changed files with 145 additions and 150 deletions
|
@ -91,19 +91,19 @@ class PostgreSQLDatabaseCreationTests(SimpleTestCase):
|
|||
self.assertEqual(suffix, expected)
|
||||
|
||||
def test_sql_table_creation_suffix_with_none_settings(self):
|
||||
settings = dict(CHARSET=None, TEMPLATE=None)
|
||||
settings = {'CHARSET': None, 'TEMPLATE': None}
|
||||
self.check_sql_table_creation_suffix(settings, "")
|
||||
|
||||
def test_sql_table_creation_suffix_with_encoding(self):
|
||||
settings = dict(CHARSET='UTF8')
|
||||
settings = {'CHARSET': 'UTF8'}
|
||||
self.check_sql_table_creation_suffix(settings, "WITH ENCODING 'UTF8'")
|
||||
|
||||
def test_sql_table_creation_suffix_with_template(self):
|
||||
settings = dict(TEMPLATE='template0')
|
||||
settings = {'TEMPLATE': 'template0'}
|
||||
self.check_sql_table_creation_suffix(settings, 'WITH TEMPLATE "template0"')
|
||||
|
||||
def test_sql_table_creation_suffix_with_encoding_and_template(self):
|
||||
settings = dict(CHARSET='UTF8', TEMPLATE='template0')
|
||||
settings = {'CHARSET': 'UTF8', 'TEMPLATE': 'template0'}
|
||||
self.check_sql_table_creation_suffix(settings, '''WITH ENCODING 'UTF8' TEMPLATE "template0"''')
|
||||
|
||||
def _execute_raise_database_already_exists(self, cursor, parameters, keepdb=False):
|
||||
|
|
|
@ -970,9 +970,7 @@ class ThreadTests(TransactionTestCase):
|
|||
t.start()
|
||||
t.join()
|
||||
# Each created connection got different inner connection.
|
||||
self.assertEqual(
|
||||
len(set(conn.connection for conn in connections_dict.values())),
|
||||
3)
|
||||
self.assertEqual(len({conn.connection for conn in connections_dict.values()}), 3)
|
||||
# Finish by closing the connections opened by the other threads (the
|
||||
# connection opened in the main thread will automatically be closed on
|
||||
# teardown).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue