Django

Code

Show
Ignore:
Timestamp:
07/30/08 12:46:02 (4 months ago)
Author:
jbronn
Message:

gis: Now plays nice with the Django test suite if the spatial prerequisites aren't installed.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/gis/django/contrib/gis/tests/__init__.py

    r7641 r8155  
    4545        test_suite_names.append('test_geoip') 
    4646 
    47 def suite(): 
    48     "Builds a test suite for the GIS package." 
     47def geo_suite(): 
     48    """ 
     49    Builds a test suite for the GIS package.  This is not named 
     50    `suite` so it will not interfere with the Django test suite (since 
     51    spatial database tables are required to execute these tests on 
     52    some backends). 
     53    """ 
    4954    s = TestSuite() 
    5055    for test_suite in test_suite_names: 
     
    5560def run(verbosity=1): 
    5661    "Runs the tests that do not require geographic (GEOS, GDAL, etc.) models." 
    57     TextTestRunner(verbosity=verbosity).run(suite()) 
     62    TextTestRunner(verbosity=verbosity).run(geo_suite()) 
    5863 
    5964def run_tests(module_list, verbosity=1, interactive=True): 
     
    106111    # Creating the test suite, adding the test models to INSTALLED_APPS, and 
    107112    #  adding the model test suites to our suite package. 
    108     test_suite = suite() 
     113    test_suite = geo_suite() 
    109114    for test_model in test_models: 
    110115        module_name = 'django.contrib.gis.tests.%s' % test_model