Browse files

Fixed #5430 -- Improved docs for running Django's own unit tests in …

…docs/contributing.txt. Thanks, akaihola

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
adrianholovaty committed Sep 15, 2007
1 parent b7e90a0 commit 061ed82b22679113d65a69b0a41ba22d3ae618d3
Showing with 25 additions and 4 deletions.
  1. +25 −4 docs/contributing.txt
@@ -654,10 +654,31 @@ 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
+If you're using the ``sqlite3`` database backend, no further settings are
+needed. A temporary database will be created in memory when running the tests.
+If you're using another backend:
+ * Your ``DATABASE_USER`` setting needs to specify an existing user account
+ for the database engine.
+ * The ``DATABASE_NAME`` setting must be the name of an existing database to
+ which the given user has permission to connect. The unit tests will not
+ touch this database; the test runner creates a new database whose name is
+ ``DATABASE_NAME`` prefixed with ``test_``, and this test database is
+ deleted when the tests are finished. This means your user account needs
+ permission to execute ``CREATE DATABASE``.
+To run a subset of the unit tests, append the names of the test modules to the
+```` command line. See the list of directories in
+``tests/modeltests`` and ``tests/regressiontests`` for module names.
+As an example, if Django is not in your ``PYTHONPATH``, you placed
+```` in the ``tests/`` directory, and you'd like to only run tests
+for generic relations and internationalization, type::
+ ./ --settings=settings generic_relations i18n
Requesting features

0 comments on commit 061ed82

Please sign in to comment.