def geodjango_suite(apps=True):
 import sys
 from django.db.models import get_app
 suite = unittest.TestSuite()
 from django.contrib.gis.geos import tests as geos_tests
 suite.addTest(geos_tests.suite())
 from django.contrib.gis.gdal import HAS_GDAL
 if HAS_GDAL:
  from django.contrib.gis.gdal import tests as gdal_tests
  suite.addTest(gdal_tests.suite())
 else:
  sys.stderr.write('GDAL not available - no tests requiring GDAL will be run.\n')
 from django.contrib.gis.geoip import HAS_GEOIP
 if (HAS_GEOIP and hasattr(settings, 'GEOIP_PATH')):
  from django.contrib.gis.geoip import tests as geoip_tests
  suite.addTest(geoip_tests.suite())
 if apps:
  for app_name in geo_apps(namespace=False):
   suite.addTest(build_suite(get_app(app_name)))
 return suite

def geodjango_suite ( apps = True ) : import sys from django . db . models import get_app suite = unittest . TestSuite ( ) from django . contrib . gis . geos import tests as geos_tests suite . addTest ( geos_tests . suite ( ) ) from django . contrib . gis . gdal import HAS_GDAL if HAS_GDAL : from django . contrib . gis . gdal import tests as gdal_tests suite . addTest ( gdal_tests . suite ( ) ) else : sys . stderr . write ( 'GDAL not available - no tests requiring GDAL will be run.\n' ) from django . contrib . gis . geoip import HAS_GEOIP if ( HAS_GEOIP and hasattr ( settings , 'GEOIP_PATH' ) ) : from django . contrib . gis . geoip import tests as geoip_tests suite . addTest ( geoip_tests . suite ( ) ) if apps : for app_name in geo_apps ( namespace = False ) : suite . addTest ( build_suite ( get_app ( app_name ) ) ) return suite
returns a testsuite consisting only of geodjango tests that can be run .