Author: jpellerin Date: 2006-07-19 11:40:16 -0500 (Wed, 19 Jul 2006) New Revision: 3382
Modified: django/branches/multiple-db-support/tests/modeltests/multiple_databases/models.py Log: [multi-db] Fixed broken tests. Modified: django/branches/multiple-db-support/tests/modeltests/multiple_databases/models.py =================================================================== --- django/branches/multiple-db-support/tests/modeltests/multiple_databases/models.py 2006-07-19 16:38:57 UTC (rev 3381) +++ django/branches/multiple-db-support/tests/modeltests/multiple_databases/models.py 2006-07-19 16:40:16 UTC (rev 3382) @@ -75,9 +75,14 @@ API_TESTS = """ # See what connections are defined. django.db.connections acts like a dict. ->>> from django.db import connection, connections +>>> from django.db import connection, connections, _default >>> from django.conf import settings ->>> connections.keys() + +# The default connection is in there, but let's ignore it + +>>> non_default = connections.keys() +>>> non_default.remove(_default) +>>> non_default ['django_test_db_a', 'django_test_db_b'] # Each connection references its settings @@ -95,15 +100,15 @@ ImproperlyConfigured: No database connection 'bad' has been configured # Models can access their connections through their managers ->>> Artist.objects.db == connections['django_test_db_a'] +>>> Artist.objects.db is connections['django_test_db_a'] True ->>> Widget.objects.db == connections['django_test_db_b'] +>>> Widget.objects.db is connections['django_test_db_b'] True ->>> Vehicle.objects.db.connection == connection +>>> Vehicle.objects.db.connection.settings.DATABASE_NAME == connection.settings.DATABASE_NAME True ->>> Artist.objects.db == Widget.objects.db +>>> Artist.objects.db is Widget.objects.db False ->>> Artist.objects.db.connection == Vehicle.objects.db.connection +>>> Artist.objects.db.connection is Vehicle.objects.db.connection False >>> a = Artist(name="Paul Klee", alive=False) >>> a.save() --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-updates -~----------~----~----~----~------~----~------~--~---
