Author: russellm
Date: 2010-08-23 02:43:50 -0500 (Mon, 23 Aug 2010)
New Revision: 13626

Modified:
   django/trunk/docs/topics/testing.txt
Log:
Fixed #3051 -- Documented the requirements for standalone testing. Thanks to 
Daniel Roseman for the draft text.

Modified: django/trunk/docs/topics/testing.txt
===================================================================
--- django/trunk/docs/topics/testing.txt        2010-08-23 07:15:14 UTC (rev 
13625)
+++ django/trunk/docs/topics/testing.txt        2010-08-23 07:43:50 UTC (rev 
13626)
@@ -309,6 +309,24 @@
 but not gracefully. No details of the tests run before the interruption will
 be reported, and any test databases created by the run will not be destroyed.
 
+Running tests outside the test runner
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If you want to run tests outside of ``./manage.py test`` -- for example,
+from a shell prompt -- you will need to set up the test
+environment first. Django provides a convenience method to do this::
+
+    >>> from django.test.utils import setup_test_environment
+    >>> setup_test_environment()
+
+This convenience method sets up the test database, and puts other
+Django features into modes that allow for repeatable testing.
+
+The call to :meth:`~django.test.utils.setup_test_environment` is made
+automatically as part of the setup of `./manage.py test`. You only
+need to manually invoke this method if you're not using running your
+tests via Django's test runner.
+
 The test database
 -----------------
 

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to