Django

Code

Changeset 6295

Show
Ignore:
Timestamp:
09/15/07 12:44:14 (1 year ago)
Author:
adrian
Message:

Fixed #5430 -- Improved docs for running Django's own unit tests in docs/contributing.txt. Thanks, akaihola

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/contributing.txt

    r6110 r6295  
    655655setting (any non-zero integer value will do) in order for all the tests to pass. 
    656656 
    657 The unit tests will not touch your existing databases; they create a new 
    658 database, called ``django_test_db``, which is deleted when the tests are 
    659 finished. This means your user account needs permission to execute ``CREATE 
    660 DATABASE``. 
     657If you're using the ``sqlite3`` database backend, no further settings are 
     658needed. A temporary database will be created in memory when running the tests. 
     659 
     660If you're using another backend: 
     661 
     662    * Your ``DATABASE_USER`` setting needs to specify an existing user account 
     663      for the database engine. 
     664 
     665    * The ``DATABASE_NAME`` setting must be the name of an existing database to 
     666      which the given user has permission to connect. The unit tests will not 
     667      touch this database; the test runner creates a new database whose name is 
     668      ``DATABASE_NAME`` prefixed with ``test_``, and this test database is 
     669      deleted when the tests are finished. This means your user account needs 
     670      permission to execute ``CREATE DATABASE``. 
     671 
     672To run a subset of the unit tests, append the names of the test modules to the 
     673``runtests.py`` command line. See the list of directories in 
     674``tests/modeltests`` and ``tests/regressiontests`` for module names. 
     675 
     676As an example, if Django is not in your ``PYTHONPATH``, you placed 
     677``settings.py`` in the ``tests/`` directory, and you'd like to only run tests 
     678for generic relations and internationalization, type:: 
     679 
     680    PYTHONPATH=.. 
     681    ./runtests.py --settings=settings generic_relations i18n 
    661682 
    662683Requesting features