Corrected the way databases were compared. This allows running the test suite with two in memory SQLite databases.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14619 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Alex Gaynor 2010-11-19 08:08:08 +00:00
parent f777ddf3e6
commit 49d831380f
3 changed files with 17 additions and 34 deletions

View File

@ -24,7 +24,7 @@ class BaseDatabaseWrapper(local):
self.use_debug_cursor = None
def __eq__(self, other):
return self.settings_dict == other.settings_dict
return self.alias == other.alias
def __ne__(self, other):
return not self == other

View File

@ -892,28 +892,12 @@ info. Your :setting:`DATABASES` setting needs to define two databases:
want. It doesn't need to use the same backend as the ``default``
database (although it can use the same backend if you want to).
If you're using the SQLite database backend, you need to define
:setting:`ENGINE` for both databases, plus a
:setting:`TEST_NAME` for the ``other`` database. The
following is a minimal settings file that can be used to test SQLite::
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3'
},
'other': {
'ENGINE': 'django.db.backends.sqlite3',
'TEST_NAME': 'other_db'
}
}
As a convenience, this settings file is included in your Django
distribution. It is called ``test_sqlite``, and is included in
the ``tests`` directory. This allows you to get started running
the tests against the sqlite database without doing anything on
your filesystem. However it should be noted that running against
other database backends is recommended for certain types of test
cases.
As a convenience, a minimal settings file, using two in memory SQLite
databases, is included in your Django distribution. It is called
``test_sqlite``, and is included in the ``tests`` directory. This allows you to
get started running the tests against the sqlite database without doing
anything on your filesystem. However it should be noted that running against
other database backends is recommended for certain types of test cases.
To run the tests with this included settings file, ``cd``
to the ``tests/`` directory and type:

View File

@ -18,6 +18,5 @@ DATABASES = {
},
'other': {
'ENGINE': 'django.db.backends.sqlite3',
'TEST_NAME': 'other_db'
}
}