From b92f683f2dee195cc23c7aa13e973fecd6ab35a7 Mon Sep 17 00:00:00 2001 From: Jason Pellerin Date: Thu, 14 Sep 2006 20:18:24 +0000 Subject: [multi-db] Fixed bugs in handling of pending references. Fixed dropping of test database, and ensured that it drops even if syncdb() fails. git-svn-id: http://code.djangoproject.com/svn/django/branches/multiple-db-support@3760 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/modeltests/multiple_databases/models.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'tests/modeltests/multiple_databases/models.py') diff --git a/tests/modeltests/multiple_databases/models.py b/tests/modeltests/multiple_databases/models.py index ce0be8f6c1..97e91b429c 100644 --- a/tests/modeltests/multiple_databases/models.py +++ b/tests/modeltests/multiple_databases/models.py @@ -78,19 +78,20 @@ __test__ = {'API_TESTS': """ >>> from django.db import connection, connections, _default, model_connection_name >>> from django.conf import settings -# The default connection is in there, but let's ignore it +# Connections are referenced by name +>>> connections['_a'] +Connection: ... +>>> connections['_b'] +Connection: ... + +# Let's see what connections are available.The default connection is +# in there, but let's ignore it >>> non_default = connections.keys() >>> non_default.remove(_default) >>> non_default.sort() >>> non_default ['_a', '_b'] - -# Each connection references its settings ->>> connections['_a'].settings.DATABASE_NAME == settings.OTHER_DATABASES['_a']['DATABASE_NAME'] -True ->>> connections['_b'].settings.DATABASE_NAME == settings.OTHER_DATABASES['_b']['DATABASE_NAME'] -True # Invalid connection names raise ImproperlyConfigured >>> connections['bad'] -- cgit v1.3