1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

Refs #2333 - Added a TEST_DATABASE_NAME setting that can be used to override the 'test_' + DATABASE_NAME naming policy. This setting is then used in runtests.py to restore the use of 'django_test_db' as the Django model/regression test database. Thanks to Michael Radziej for the feedback.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3706 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2006-09-01 13:33:26 +00:00
parent 60ebb616a9
commit d78e2ae355
5 changed files with 39 additions and 12 deletions

View File

@@ -301,4 +301,9 @@ AUTHENTICATION_BACKENDS = ('django.contrib.auth.backends.ModelBackend',)
# TESTING #
###########
TEST_RUNNER='django.test.simple.run_tests'
# The name of the method to use to invoke the test suite
TEST_RUNNER = 'django.test.simple.run_tests'
# The name of the database to use for testing purposes.
# If None, a name of 'test_' + DATABASE_NAME will be assumed
TEST_DATABASE_NAME = None

View File

@@ -21,7 +21,10 @@ def create_test_db(verbosity=1, autoclobber=False):
if settings.DATABASE_ENGINE == "sqlite3":
TEST_DATABASE_NAME = ":memory:"
else:
TEST_DATABASE_NAME = TEST_DATABASE_PREFIX + settings.DATABASE_NAME
if settings.TEST_DATABASE_NAME:
TEST_DATABASE_NAME = settings.TEST_DATABASE_NAME
else:
TEST_DATABASE_NAME = TEST_DATABASE_PREFIX + settings.DATABASE_NAME
# Create the test database and connect to it. We need to autocommit
# if the database supports it because PostgreSQL doesn't allow