Django

Code

Changeset 3181

Show
Ignore:
Timestamp:
06/20/06 09:27:44 (2 years ago)
Author:
adrian
Message:

Fixed runtests.py problem from [3177] where it assumed you were running the tests from within the tests directory

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/tests/runtests.py

    r3177 r3181  
    2525ALWAYS_INSTALLED_APPS = [ 
    2626    'django.contrib.contenttypes', 
    27     'django.contrib.auth',  
     27    'django.contrib.auth', 
    2828    'django.contrib.sites', 
    2929    'django.contrib.flatpages', 
     
    3636def get_test_models(): 
    3737    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): 
    4040            if f.startswith('__init__') or f.startswith('.') or f.startswith('sql'): 
    4141                continue 
     
    140140        else: 
    141141            # 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 
    143143            # CREATE/DROP DATABASE statements within transactions. 
    144144            cursor = connection.cursor() 
     
    162162        # Initialize the test database. 
    163163        cursor = connection.cursor() 
    164          
     164 
    165165        # Install the core always installed apps 
    166166        for app in ALWAYS_INSTALLED_APPS: 
     
    266266        else: 
    267267            print "All tests passed." 
    268              
     268 
    269269    def _set_autocommit(self, connection): 
    270270        """