diff options
| author | Jason Pellerin <jpellerin@gmail.com> | 2006-09-14 20:18:24 +0000 |
|---|---|---|
| committer | Jason Pellerin <jpellerin@gmail.com> | 2006-09-14 20:18:24 +0000 |
| commit | b92f683f2dee195cc23c7aa13e973fecd6ab35a7 (patch) | |
| tree | 9b586e31dfbded7f99951dad4f21d931ee9ac2b6 /tests/modeltests | |
| parent | 432070d0fbf20b800e667012fd220ae26e3f579f (diff) | |
[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
Diffstat (limited to 'tests/modeltests')
| -rw-r--r-- | tests/modeltests/multiple_databases/models.py | 15 |
1 files changed, 8 insertions, 7 deletions
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'] |
