Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed runtests.py problem from [3177] where it assumed you were runni…

…ng the tests from within the tests directory

git-svn-id: http://code.djangoproject.com/svn/django/trunk@3181 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 0e92f706025606e27fb4a7fd593914b172f84c76 1 parent 5f47161
Adrian Holovaty authored June 20, 2006

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

  1. 12  tests/runtests.py
12  tests/runtests.py
@@ -24,7 +24,7 @@ def log_error(model_name, title, description):
24 24
 
25 25
 ALWAYS_INSTALLED_APPS = [
26 26
     'django.contrib.contenttypes',
27  
-    'django.contrib.auth', 
  27
+    'django.contrib.auth',
28 28
     'django.contrib.sites',
29 29
     'django.contrib.flatpages',
30 30
     'django.contrib.redirects',
@@ -35,8 +35,8 @@ def log_error(model_name, title, description):
35 35
 
36 36
 def get_test_models():
37 37
     models = []
38  
-    for loc in MODEL_TESTS_DIR_NAME, REGRESSION_TESTS_DIR_NAME:
39  
-        for f in os.listdir(loc):
  38
+    for loc, dirpath in (MODEL_TESTS_DIR_NAME, MODEL_TEST_DIR), (REGRESSION_TESTS_DIR_NAME, REGRESSION_TEST_DIR):
  39
+        for f in os.listdir(dirpath):
40 40
             if f.startswith('__init__') or f.startswith('.') or f.startswith('sql'):
41 41
                 continue
42 42
             models.append((loc, f))
@@ -139,7 +139,7 @@ def run_tests(self):
139 139
             TEST_DATABASE_NAME = ":memory:"
140 140
         else:
141 141
             # Create the test database and connect to it. We need to autocommit
142  
-            # if the database supports it because PostgreSQL doesn't allow 
  142
+            # if the database supports it because PostgreSQL doesn't allow
143 143
             # CREATE/DROP DATABASE statements within transactions.
144 144
             cursor = connection.cursor()
145 145
             self._set_autocommit(connection)
@@ -161,7 +161,7 @@ def run_tests(self):
161 161
 
162 162
         # Initialize the test database.
163 163
         cursor = connection.cursor()
164  
-        
  164
+
165 165
         # Install the core always installed apps
166 166
         for app in ALWAYS_INSTALLED_APPS:
167 167
             self.output(1, "Installing contrib app %s" % app)
@@ -265,7 +265,7 @@ def run_tests(self):
265 265
             print "%s error%s:" % (len(error_list), len(error_list) != 1 and 's' or '')
266 266
         else:
267 267
             print "All tests passed."
268  
-            
  268
+
269 269
     def _set_autocommit(self, connection):
270 270
         """
271 271
         Make sure a connection is in autocommit mode.

0 notes on commit 0e92f70

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