In order to pass the unit tests running on a fresh install of django trunk (1.4c1), it is necessary to add in a 'dummy' other
database in settings.py, like this:-
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'mydb', # Or path to database file if using sqlite3.
'USER': 'myuser', # Not used with sqlite3.
'PASSWORD': 'mypassword', # Not used with sqlite3.
'HOST': 'localhost', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '5432', # Set to empty string for default. Not used with sqlite3.
},
# dummy sqlite3 database created to pass django's builtin unit tests
'other': {
'ENGINE': 'django.db.backends.sqlite3'
}
}
Why is that so and what is the purpose of this "ensure_defaults" function in django/db/utils.py's ConnectionHandler
class?
Just curious to understand django at a deeper level...