1
0
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:
Alex Gaynor
2009-06-03 01:58:33 +00:00
parent 4cd29f2520
commit bce55b1aa8
15 changed files with 232 additions and 152 deletions

View 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()