| | 314 | |
| | 315 | Using tests outside the test runner |
| | 316 | ----------------------------------- |
| | 317 | |
| | 318 | If you want to run tests outside of ``./manage.py test`` - for example in your |
| | 319 | views, or in the shell - you will need to set up the test environment first. |
| | 320 | You 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 | |
| | 326 | Note that this is done for you automatically by `./manage.py test`, and is only |
| | 327 | needed if you're not using running your tests via that command. |
| | 328 | |
| | 329 | |