mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
[soc2009/multidb] Implemented a connections object that is responsible for tracking multiple database connections and lazily instantiating them. Also implemneted the DATABASES setting which replaces the various DATABASE_* settings
git-svn-id: http://code.djangoproject.com/svn/django/branches/soc2009/multidb@10892 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
17
tests/regressiontests/multiple_database/tests.py
Normal file
17
tests/regressiontests/multiple_database/tests.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from django.conf import settings
|
||||
from django.db import connections
|
||||
from django.test import TestCase
|
||||
|
||||
class DatabaseSettingTestCase(TestCase):
|
||||
def setUp(self):
|
||||
settings.DATABASES['__test_db'] = {
|
||||
'DATABASE_ENGINE': 'sqlite3',
|
||||
'DATABASE_NAME': ':memory:',
|
||||
}
|
||||
|
||||
def tearDown(self):
|
||||
del settings.DATABASES['__test_db']
|
||||
|
||||
def test_db_connection(self):
|
||||
connections['default'].cursor()
|
||||
connections['__test_db'].cursor()
|
||||
Reference in New Issue
Block a user