1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Moved an import to the toplevel.

This commit is contained in:
Aymeric Augustin
2015-09-05 21:52:36 +02:00
parent 6d1110f2f0
commit c4bdf52005
2 changed files with 6 additions and 7 deletions

View File

@@ -240,7 +240,7 @@ class DummyBackendTest(unittest.TestCase):
Test that setup_databases() doesn't fail with dummy database backend.
"""
tested_connections = db.ConnectionHandler({})
with mock.patch('django.db.connections', new=tested_connections):
with mock.patch('django.test.runner.connections', new=tested_connections):
runner_instance = DiscoverRunner(verbosity=0)
try:
old_config = runner_instance.setup_databases()
@@ -263,7 +263,7 @@ class AliasedDefaultTestSetupTest(unittest.TestCase):
'NAME': 'dummy'
}
})
with mock.patch('django.db.connections', new=tested_connections):
with mock.patch('django.test.runner.connections', new=tested_connections):
runner_instance = DiscoverRunner(verbosity=0)
try:
old_config = runner_instance.setup_databases()
@@ -291,7 +291,7 @@ class SetupDatabasesTests(unittest.TestCase):
})
with mock.patch('django.db.backends.dummy.base.DatabaseCreation') as mocked_db_creation:
with mock.patch('django.db.connections', new=tested_connections):
with mock.patch('django.test.runner.connections', new=tested_connections):
old_config = self.runner_instance.setup_databases()
self.runner_instance.teardown_databases(old_config)
mocked_db_creation.return_value.destroy_test_db.assert_called_once_with('dbname', 0, False)
@@ -316,7 +316,7 @@ class SetupDatabasesTests(unittest.TestCase):
},
})
with mock.patch('django.db.backends.dummy.base.DatabaseCreation') as mocked_db_creation:
with mock.patch('django.db.connections', new=tested_connections):
with mock.patch('django.test.runner.connections', new=tested_connections):
self.runner_instance.setup_databases()
mocked_db_creation.return_value.create_test_db.assert_called_once_with(
0, autoclobber=False, serialize=True, keepdb=False
@@ -330,7 +330,7 @@ class SetupDatabasesTests(unittest.TestCase):
},
})
with mock.patch('django.db.backends.dummy.base.DatabaseCreation') as mocked_db_creation:
with mock.patch('django.db.connections', new=tested_connections):
with mock.patch('django.test.runner.connections', new=tested_connections):
self.runner_instance.setup_databases()
mocked_db_creation.return_value.create_test_db.assert_called_once_with(
0, autoclobber=False, serialize=False, keepdb=False