From 49ce784805b9db3cc7523f2c391cc67f934dddca Mon Sep 17 00:00:00 2001 From: Jason Pellerin Date: Tue, 11 Jul 2006 20:38:27 +0000 Subject: [PATCH] [multi-db] Changed name of optional named databases setting to OTHER_DATABASES. git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3335 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/conf/global_settings.py | 2 +- tests/runtests.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/django/conf/global_settings.py b/django/conf/global_settings.py index 9ef92e10dd..ec201893f8 100644 --- a/django/conf/global_settings.py +++ b/django/conf/global_settings.py @@ -98,7 +98,7 @@ DATABASE_HOST = '' # Set to empty string for localhost. Not used wit DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3. # Optional named database connections in addition to the default. -DATABASES = {} +OTHER_DATABASES = {} # Host for sending e-mail. EMAIL_HOST = 'localhost' diff --git a/tests/runtests.py b/tests/runtests.py index 85f0c67785..b712d1352a 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -163,7 +163,7 @@ class TestRunner: # replacing any named connections defined in settings. All connections # will use the default DATABASE_ENGINE self.old_database_name = settings.DATABASE_NAME - self.old_databases = settings.DATABASES + self.old_databases = settings.OTHER_DATABASES if settings.DATABASE_ENGINE == 'sqlite3': # If we're using SQLite, it's more convenient to test against an @@ -173,7 +173,7 @@ class TestRunner: new_databases = {} for db_name in TEST_DATABASES: - db_st = settings.DATABASES.setdefault(db_name, {}) + db_st = settings.OTHER_DATABASES.setdefault(db_name, {}) engine = db_st.get('DATABASE_ENGINE', settings.DATABASE_ENGINE) if engine == 'sqlite3': db_st['DATABASE_NAME'] = self._tempfile() @@ -181,10 +181,10 @@ class TestRunner: else: db_st['DATABASE_NAME'] = db_name new_databases[db_name] = db_st - settings.DATABASES = new_databases + settings.OTHER_DATABASES = new_databases self.create_test_db(TEST_DATABASE_NAME, connection) - for name, info in settings.DATABASES.items(): + for name, info in settings.OTHER_DATABASES.items(): cx = connections[name] test_connection = self.create_test_db(info['DATABASE_NAME'], cx.connection) @@ -205,7 +205,7 @@ class TestRunner: from django.conf import settings connection.close() settings.DATABASE_NAME = self.old_database_name - settings.DATABASES = self.old_databases + settings.OTHER_DATABASES = self.old_databases for db_name, cx in self.created_dbs: settings = cx.settings cx.close()