Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Split up the documentation of the test database and the test output.

Refs #6134.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6929 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 8ecff6b91c9cb8fac466552e36cfbdb3d5145148 1 parent 4a25cf5
Malcolm Tredinnick authored December 17, 2007

Showing 1 changed file with 27 additions and 21 deletions. Show diff stats Hide diff stats

  1. 48  docs/testing.txt
48  docs/testing.txt
@@ -270,27 +270,20 @@ a test case, add the name of the test method to the label::
270 270
 
271 271
     $ ./manage.py test animals.AnimalTestCase.testFluffyAnimals
272 272
 
273  
-Understanding the test output
274  
------------------------------
275  
-
276  
-When you run your tests, you'll see a number of messages as the test runner
277  
-prepares itself::
  273
+The test database
  274
+-----------------
278 275
 
279  
-    Creating test database...
280  
-    Creating table myapp_animal
281  
-    Creating table myapp_mineral
282  
-    Loading 'initial_data' fixtures...
283  
-    No fixtures found.
  276
+Tests that require a database (namely, model tests) will not use
  277
+your "real" (production) database. A separate, blank database is created
  278
+for the tests.
284 279
 
285  
-This tells you that the test runner is creating a test database -- a blank,
286  
-from-scratch database that it will use for any tests that happen to require a
287  
-database (namely, model tests).
  280
+Regardless of whether the tests pass or fail, the test database is destroyed
  281
+when all the tests have been executed.
288 282
 
289  
-Don't worry -- the test runner will not touch your "real" (production)
290  
-database. It creates a separate database purely for the tests. This test
291  
-database gets its name by prepending ``test_`` to the value of the
292  
-``DATABASE_NAME`` setting. If you want to use a different name, specify the
293  
-``TEST_DATABASE_NAME`` setting.
  283
+By default this test database gets its name by prepending ``test_`` to the
  284
+value of the ``DATABASE_NAME`` setting. When using the SQLite database engine
  285
+the tests will by default use a memory resident database. If you want to use
  286
+a different database name, specify the ``TEST_DATABASE_NAME`` setting.
294 287
 
295 288
 Aside from using a separate database, the test runner will otherwise use all of
296 289
 the same database settings you have in your settings file: ``DATABASE_ENGINE``,
@@ -306,6 +299,22 @@ settings_ documentation for details of these advanced settings.
306 299
 
307 300
 .. _settings: ../settings/
308 301
 
  302
+Understanding the test output
  303
+-----------------------------
  304
+
  305
+When you run your tests, you'll see a number of messages as the test runner
  306
+prepares itself. You can control the level of detail of these messages with the
  307
+``verbosity`` option on the command line::
  308
+
  309
+    Creating test database...
  310
+    Creating table myapp_animal
  311
+    Creating table myapp_mineral
  312
+    Loading 'initial_data' fixtures...
  313
+    No fixtures found.
  314
+
  315
+This tells you that the test runner is creating a test database, as described
  316
+in the previous section.
  317
+
309 318
 Once the test database has been created, Django will run your tests.
310 319
 If everything goes well, you'll see something like this::
311 320
 
@@ -349,9 +358,6 @@ failed and erroneous tests. If all the tests pass, the return code is 0. This
349 358
 feature is useful if you're using the test-runner script in a shell script and
350 359
 need to test for success or failure at that level.
351 360
 
352  
-Regardless of whether the tests pass or fail, the test database is destroyed when
353  
-all the tests have been executed.
354  
-
355 361
 Testing tools
356 362
 =============
357 363
 

0 notes on commit 8ecff6b

Please sign in to comment.
Something went wrong with that request. Please try again.