Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Adjusted runtests to the new layout.

  • Loading branch information...
commit fc074db29c29e6a5d46f09e01caeea47902e046a 1 parent 89f40e3
@apollo13 apollo13 authored
Showing with 9 additions and 12 deletions.
  1. +9 −12 tests/runtests.py
View
21 tests/runtests.py
@@ -10,15 +10,11 @@
from django.utils import six
CONTRIB_DIR_NAME = 'django.contrib'
-MODEL_TESTS_DIR_NAME = 'modeltests'
-REGRESSION_TESTS_DIR_NAME = 'regressiontests'
TEST_TEMPLATE_DIR = 'templates'
RUNTESTS_DIR = os.path.dirname(upath(__file__))
CONTRIB_DIR = os.path.dirname(upath(contrib.__file__))
-MODEL_TEST_DIR = os.path.join(RUNTESTS_DIR, MODEL_TESTS_DIR_NAME)
-REGRESSION_TEST_DIR = os.path.join(RUNTESTS_DIR, REGRESSION_TESTS_DIR_NAME)
TEMP_DIR = tempfile.mkdtemp(prefix='django_')
os.environ['DJANGO_TEST_TEMP_DIR'] = TEMP_DIR
@@ -37,9 +33,9 @@
'django.contrib.admindocs',
'django.contrib.staticfiles',
'django.contrib.humanize',
- 'regressiontests.staticfiles_tests',
- 'regressiontests.staticfiles_tests.apps.test',
- 'regressiontests.staticfiles_tests.apps.no_label',
+ 'staticfiles_tests',
+ 'staticfiles_tests.apps.test',
+ 'staticfiles_tests.apps.no_label',
]
def geodjango(settings):
@@ -51,12 +47,10 @@ def geodjango(settings):
def get_test_modules():
modules = []
for loc, dirpath in (
- (MODEL_TESTS_DIR_NAME, MODEL_TEST_DIR),
- (REGRESSION_TESTS_DIR_NAME, REGRESSION_TEST_DIR),
+ (None, RUNTESTS_DIR),
(CONTRIB_DIR_NAME, CONTRIB_DIR)):
for f in os.listdir(dirpath):
- if (f.startswith('__init__') or
- f.startswith('.') or
+ if ('.' in f or
# Python 3 byte code dirs (PEP 3147)
f == '__pycache__' or
f.startswith('sql') or
@@ -118,7 +112,10 @@ def setup(verbosity, test_labels):
settings.INSTALLED_APPS.extend(['django.contrib.gis', 'django.contrib.sitemaps'])
for module_dir, module_name in test_modules:
- module_label = '.'.join([module_dir, module_name])
+ if module_dir:
+ module_label = '.'.join([module_dir, module_name])
+ else:
+ module_label = module_name
# if the module was named on the command line, or
# no modules were named (i.e., run all), import
# this module and add it to the list to test.
Please sign in to comment.
Something went wrong with that request. Please try again.