From 0615eaf24ad42e22873915bf8c1f5aca824d62c4 Mon Sep 17 00:00:00 2001 From: Shai Berger Date: Sun, 9 Mar 2014 08:33:33 +0200 Subject: [PATCH] Corrected a few missed references to old test settings --- docs/topics/testing/overview.txt | 16 +++++++++++----- tests/requests/tests.py | 2 +- tests/transactions_regress/tests.py | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/topics/testing/overview.txt b/docs/topics/testing/overview.txt index 7a2d15edceef7..19fff1ed1c8ce 100644 --- a/docs/topics/testing/overview.txt +++ b/docs/topics/testing/overview.txt @@ -170,8 +170,8 @@ defined in :setting:`DATABASES`. When using the SQLite database engine the tests will by default use an in-memory database (i.e., the database will be created in memory, bypassing the filesystem entirely!). If you want to use a different database name, specify -:setting:`TEST_NAME` in the dictionary for any given database in -:setting:`DATABASES`. +:setting:`NAME ` in the :setting:`TEST ` +dictionary for any given database in :setting:`DATABASES`. Aside from using a separate database, the test runner will otherwise use all of the same database settings you have in your settings file: @@ -181,11 +181,17 @@ need to make sure that the given user account has sufficient privileges to create a new database on the system. For fine-grained control over the character encoding of your test -database, use the :setting:`TEST_CHARSET` option. If you're using -MySQL, you can also use the :setting:`TEST_COLLATION` option to +database, use the :setting:`CHARSET ` TEST option. If you're using +MySQL, you can also use the :setting:`COLLATION ` option to control the particular collation used by the test database. See the :doc:`settings documentation ` for details of these -advanced settings. +and other advanced settings. + +.. versionchanged:: 1.7 + + The different options in the :setting:`TEST ` database + setting used to be separate options in the database settings dictionary, + prefixed with ``TEST_``. .. admonition:: Finding data from your production database when running tests? diff --git a/tests/requests/tests.py b/tests/requests/tests.py index 175554e8710bc..3baee7994b1f5 100644 --- a/tests/requests/tests.py +++ b/tests/requests/tests.py @@ -699,7 +699,7 @@ def test_get_host_suggestion_of_allowed_host(self): @skipIf(connection.vendor == 'sqlite' - and connection.settings_dict['TEST_NAME'] in (None, '', ':memory:'), + and connection.settings_dict['TEST']['NAME'] in (None, '', ':memory:'), "Cannot establish two connections to an in-memory SQLite database.") class DatabaseConnectionHandlingTests(TransactionTestCase): diff --git a/tests/transactions_regress/tests.py b/tests/transactions_regress/tests.py index e3cc2bc73c3aa..917aafb3c8425 100644 --- a/tests/transactions_regress/tests.py +++ b/tests/transactions_regress/tests.py @@ -195,7 +195,7 @@ def test_failing_query_transaction_closed_debug(self): @skipIf(connection.vendor == 'sqlite' - and connection.settings_dict['TEST_NAME'] in (None, '', ':memory:'), + and connection.settings_dict['TEST']['NAME'] in (None, '', ':memory:'), "Cannot establish two connections to an in-memory SQLite database.") class TestNewConnection(IgnoreDeprecationWarningsMixin, TransactionTestCase): """