Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #10791 -- The GeoDjango test runner now respects the `--noinput…

…` command-line option, thanks to seanl for ticket & patch; replaced docstring with URL to latest documentation.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@10601 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit aeaba06bf4976cca2d97f7a39de86a385f6af777 1 parent 5a57a7f
Justin Bronn authored April 19, 2009

Showing 1 changed file with 5 additions and 40 deletions. Show diff stats Hide diff stats

  1. 45  django/contrib/gis/tests/__init__.py
45  django/contrib/gis/tests/__init__.py
@@ -115,45 +115,10 @@ def run_gis_tests(test_labels, **kwargs):
115 115
 
116 116
 def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[], suite=None):
117 117
     """
118  
-    This module allows users to run tests for GIS apps that require the creation
119  
-    of a spatial database.  Currently, this is only required for PostgreSQL as
120  
-    PostGIS needs extra overhead in test database creation.
121  
-
122  
-    In order to create a PostGIS database, the DATABASE_USER (or
123  
-    TEST_DATABASE_USER, if defined) will require superuser priviliges.
124  
-
125  
-    To accomplish this outside the `postgres` user, you have a few options:
126  
-      (A) Make your user a super user:
127  
-        This may be done at the time the user is created, for example:
128  
-        $ createuser --superuser <user_name>
129  
-
130  
-        Or you may alter the user's role from the SQL shell (assuming this
131  
-        is done from an existing superuser role):
132  
-        postgres# ALTER ROLE <user_name> SUPERUSER;
133  
-
134  
-      (B) Create your own PostgreSQL database as a local user:
135  
-        1. Initialize database: `initdb -D /path/to/user/db`
136  
-        2. If there's already a Postgres instance on the machine, it will need
137  
-           to use a different TCP port than 5432. Edit postgresql.conf (in
138  
-           /path/to/user/db) to change the database port (e.g. `port = 5433`).
139  
-        3. Start this database `pg_ctl -D /path/to/user/db start`
140  
-
141  
-      (C) On Windows platforms the pgAdmin III utility may also be used as
142  
-        a simple way to add superuser privileges to your database user.
143  
-
144  
-    The TEST_RUNNER needs to be set in your settings like so:
145  
-
146  
-      TEST_RUNNER='django.contrib.gis.tests.run_tests'
147  
-
148  
-    Note: This test runner assumes that the PostGIS SQL files ('lwpostgis.sql'
149  
-    and 'spatial_ref_sys.sql') are installed in the directory specified by
150  
-    `pg_config --sharedir` (and defaults to /usr/local/share if that fails).
151  
-    This behavior is overridden if POSTGIS_SQL_PATH is set in your settings.
152  
-
153  
-    Windows users should set POSTGIS_SQL_PATH manually because the output
154  
-    of `pg_config` uses paths like 'C:/PROGRA~1/POSTGR~1/..'.
155  
-
156  
-    Finally, the tests may be run by invoking `./manage.py test`.
  118
+    Set `TEST_RUNNER` in your settings with this routine in order to
  119
+    scaffold test spatial databases correctly for your GeoDjango models.
  120
+    For more documentation, please consult the following URL:
  121
+      http://geodjango.org/docs/testing.html.
157 122
     """
158 123
     from django.conf import settings
159 124
     from django.db import connection
@@ -171,7 +136,7 @@ def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[], suite=
171 136
     old_name = settings.DATABASE_NAME
172 137
 
173 138
     # Creating the test spatial database.
174  
-    create_test_spatial_db(verbosity=verbosity)
  139
+    create_test_spatial_db(verbosity=verbosity, autoclobber=not interactive)
175 140
 
176 141
     # The suite may be passed in manually, e.g., when we run the GeoDjango test,
177 142
     # we want to build it and pass it in due to some customizations.  Otherwise,

0 notes on commit aeaba06

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