Django

Code

Changeset 3177

Show
Ignore:
Timestamp:
06/20/06 02:12:45 (2 years ago)
Author:
mtredinnick
Message:

Fixed #2161 -- handle trailing newlines in initial SQL data. Includes
regression test. Thanks to russellm.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/core/management.py

    r3174 r3177  
    335335    # so split into separate statements. 
    336336    sql_expr = re.compile( 
    337         r"""(           # each statement is... 
    338         (?:             # one or more chunks of ... 
     337        r"""(           # each statement ... 
     338        [^\r\n;]        # starts with something other than a line ending or ';' 
     339        (?:             # then has one or more chunks of ... 
    339340            (?:[^;'"]+) # not the end of a statement or start of a quote 
    340341          | (?:'[^']*') # something in single quotes 
  • django/trunk/tests/runtests.py

    r3176 r3177  
    3535 
    3636def get_test_models(): 
    37     return [(MODEL_TESTS_DIR_NAME, f) for f in os.listdir(MODEL_TEST_DIR) if not f.startswith('__init__') and not f.startswith('.')] +\ 
    38         [(REGRESSION_TESTS_DIR_NAME, f) for f in os.listdir(REGRESSION_TEST_DIR) if not f.startswith('__init__') and not f.startswith('.')] 
     37    models = [] 
     38    for loc in MODEL_TESTS_DIR_NAME, REGRESSION_TESTS_DIR_NAME: 
     39        for f in os.listdir(loc): 
     40            if f.startswith('__init__') or f.startswith('.') or f.startswith('sql'): 
     41                continue 
     42            models.append((loc, f)) 
     43    return models 
    3944 
    4045class DjangoDoctestRunner(doctest.DocTestRunner):