Ticket #3051: 3051_testing.diff

File 3051_testing.diff, 976 bytes (added by Daniel Roseman, 6 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.
     315Using tests outside the test runner
     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`::
     323    >>> from django.test.utils import setup_test_environment
     324    >>> setup_test_environment()
     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.
    314330The test database
Back to Top