mirror of https://github.com/django/django.git
Refs #31117 -- Isolated backends.sqlite.test_creation.TestDbSignatureTests.
This commit is contained in:
parent
2f565f84ac
commit
c159baceba
|
@ -1,18 +1,16 @@
|
||||||
import copy
|
import copy
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from django.db import connection
|
from django.db import DEFAULT_DB_ALIAS, connection, connections
|
||||||
from django.test import SimpleTestCase
|
from django.test import SimpleTestCase
|
||||||
|
|
||||||
|
|
||||||
@unittest.skipUnless(connection.vendor == 'sqlite', 'SQLite tests')
|
@unittest.skipUnless(connection.vendor == 'sqlite', 'SQLite tests')
|
||||||
class TestDbSignatureTests(SimpleTestCase):
|
class TestDbSignatureTests(SimpleTestCase):
|
||||||
def test_custom_test_name(self):
|
def test_custom_test_name(self):
|
||||||
saved_settings = copy.deepcopy(connection.settings_dict)
|
test_connection = copy.copy(connections[DEFAULT_DB_ALIAS])
|
||||||
try:
|
test_connection.settings_dict = copy.deepcopy(connections[DEFAULT_DB_ALIAS].settings_dict)
|
||||||
connection.settings_dict['NAME'] = None
|
test_connection.settings_dict['NAME'] = None
|
||||||
connection.settings_dict['TEST']['NAME'] = 'custom.sqlite.db'
|
test_connection.settings_dict['TEST']['NAME'] = 'custom.sqlite.db'
|
||||||
signature = connection.creation.test_db_signature()
|
signature = test_connection.creation_class(test_connection).test_db_signature()
|
||||||
self.assertEqual(signature, (None, 'custom.sqlite.db'))
|
self.assertEqual(signature, (None, 'custom.sqlite.db'))
|
||||||
finally:
|
|
||||||
connection.settings_dict = saved_settings
|
|
||||||
|
|
Loading…
Reference in New Issue