Ticket #3051: 3051_testing.diff

File 3051_testing.diff, 976 bytes (added by Daniel Roseman, 14 years ago)

Better patch with more explanation and links to reference.

  • docs/topics/testing.txt

     
    311311but not gracefully. No details of the tests run before the interruption will
    312312be reported, and any test databases created by the run will not be destroyed.
    313313
     314
     315Using tests outside the test runner
     316-----------------------------------
     317
     318If you want to run tests outside of ``./manage.py test`` - for example in your
     319views, or in the shell - you will need to set up the test environment first.
     320You can do this by running :meth:`django.test.utils.setup_test_environment`::
     321
     322
     323    >>> from django.test.utils import setup_test_environment
     324    >>> setup_test_environment()
     325
     326Note that this is done for you automatically by `./manage.py test`, and is only
     327needed if you're not using running your tests via that command.
     328
     329
    314330The test database
    315331-----------------
    316332
Back to Top