Commit 49d83138 authored by Alex Gaynor's avatar Alex Gaynor
Browse files

Corrected the way databases were compared. This allows running the test suite...

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
parent f777ddf3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
+16 −32
Original line number Diff line number Diff line
@@ -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:
+0 −1
Original line number Diff line number Diff line
@@ -18,6 +18,5 @@ DATABASES = {
    },
    'other': {
        'ENGINE': 'django.db.backends.sqlite3',
        'TEST_NAME': 'other_db'
    }
}