Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.5.x] Tweaked unit test 'quick start' explanation.

Thanks Jeremy Dunck.

Backport of 490672f from master
  • Loading branch information...
commit 63cab03f6ddd9faa5a770ae08791b2a70aa0a578 1 parent 0eddedf
Tim Graham authored May 20, 2013
20  docs/internals/contributing/writing-code/unit-tests.txt
@@ -29,15 +29,13 @@ Quickstart
29 29
 Running the tests requires a Django settings module that defines the
30 30
 databases to use. To make it easy to get started, Django provides a
31 31
 sample settings module that uses the SQLite database. To run the tests
32  
-with this sample ``settings`` module, ``cd`` into the Django
33  
-``tests/`` directory and run:
  32
+with this sample ``settings`` module:
34 33
 
35 34
 .. code-block:: bash
36 35
 
37  
-    ./runtests.py --settings=test_sqlite
38  
-
39  
-If you get an ``ImportError: No module named django.contrib`` error,
40  
-you need to add your install of Django to your ``PYTHONPATH``.
  36
+    git clone git@github.com:django/django.git django-repo
  37
+    cd django-repo/tests
  38
+    PYTHONPATH=..:$PYTHONPATH python ./runtests.py --settings=test_sqlite
41 39
 
42 40
 .. _running-unit-tests-settings:
43 41
 
@@ -49,14 +47,10 @@ SQLite. If you want to test behavior using a different database (and
49 47
 if you're proposing patches for Django, it's a good idea to test
50 48
 across databases), you may need to define your own settings file.
51 49
 
52  
-To run the tests with different settings, ``cd`` to the ``tests/`` directory
53  
-and type:
54  
-
55  
-.. code-block:: bash
56  
-
57  
-    ./runtests.py --settings=path.to.django.settings
  50
+To run the tests with different settings, ensure that the module is on your
  51
+``PYTHONPATH`` and pass the module with ``--settings``.
58 52
 
59  
-The :setting:`DATABASES` setting in this test settings module needs to define
  53
+The :setting:`DATABASES` setting in any test settings module needs to define
60 54
 two databases:
61 55
 
62 56
 * A ``default`` database. This database should use the backend that

0 notes on commit 63cab03

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