#NEWLINE# def run_gis_tests( test_labels , **kwargs ) : #NEWLINE# #INDENT# '\n    Use this routine as the TEST_RUNNER in your settings in order to run the\n    GeoDjango test suite.  This must be done as a database superuser for\n    PostGIS, so read the docstring in `run_test()` below for more details.\n    ' #NEWLINE# from django.conf import settings #NEWLINE# from django.db.models import loading #NEWLINE# from django.contrib.gis.tests.utils import mysql #NEWLINE# old_installed = settings . INSTALLED_APPS #NEWLINE# old_root_urlconf = settings . ROOT_URLCONF #NEWLINE# new_installed = [ 'django.contrib.contenttypes' , 'django.contrib.auth' , 'django.contrib.sites' , 'django.contrib.sitemaps' , 'django.contrib.flatpages' , 'django.contrib.gis' , 'django.contrib.redirects' , 'django.contrib.sessions' , 'django.contrib.comments' , 'django.contrib.admin' ] #NEWLINE# settings . ROOT_URLCONF = 'django.contrib.gis.tests.urls' #NEWLINE# ( gis_suite , test_models ) = geo_suite ( ) #NEWLINE# for test_model in test_models : #NEWLINE# #INDENT# module_name = ( 'django.contrib.gis.tests.%s' % test_model ) #NEWLINE# if mysql : #NEWLINE# #INDENT# test_module_name = 'tests_mysql' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# test_module_name = 'tests' #NEWLINE# #UNINDENT# new_installed . append ( module_name ) #NEWLINE# tsuite = getattr ( __import__ ( ( 'django.contrib.gis.tests.%s' % test_model ) , globals ( ) , locals ( ) , [ test_module_name ] ) , test_module_name ) #NEWLINE# gis_suite . addTest ( tsuite . suite ( ) ) #NEWLINE# #UNINDENT# settings . INSTALLED_APPS = new_installed #NEWLINE# loading . cache . loaded = False #NEWLINE# result = run_tests ( test_labels , suite = gis_suite , ** kwargs ) #NEWLINE# settings . INSTALLED_APPS = old_installed #NEWLINE# settings . ROOT_URLCONF = old_root_urlconf #NEWLINE# return kwargs