At http://www.djangoproject.com/documentation/contributing/#unit-tests under the title "Running the unit tests", the documentation states:
Yes, the unit tests need a settings module,
but only for database connection info,
with the DATABASE_ENGINE setting.
You will also need a ROOT_URLCONF setting
(its value is ignored; it just needs to be present)
and a SITE_ID setting (any non-zero integer value
will do) in order for all the tests to pass.
The unit tests will not touch your existing databases;
they create a new database, called django_test_db,
which is deleted when the tests are finished.
This means your user account needs permission
to execute CREATE DATABASE.
For SQLite the above is true, but for at least PostgreSQL also DATABASE_NAME and DATABASE_USER need to be specified, and DATABASE_NAME must be the name of an existing database to which the user has access, but it *must not* be django_test_db.