diff options
| author | Justin Bronn <jbronn@gmail.com> | 2010-11-20 23:54:59 +0000 |
|---|---|---|
| committer | Justin Bronn <jbronn@gmail.com> | 2010-11-20 23:54:59 +0000 |
| commit | 7592d685411b35b0878b88c57df80eaeff22186f (patch) | |
| tree | 1dd0baa56452563f780e436e3a9d353f8f73d8e8 | |
| parent | d4bb8313f73020b63204e39de6599ec355b26933 (diff) | |
Now possible to run the GeoDjango test suite with a minimal settings file. Refs #10420, #14439.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14653 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/contrib/gis/tests/__init__.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/django/contrib/gis/tests/__init__.py b/django/contrib/gis/tests/__init__.py index ea0df3864a..beac8137a2 100644 --- a/django/contrib/gis/tests/__init__.py +++ b/django/contrib/gis/tests/__init__.py @@ -30,8 +30,9 @@ class GeoDjangoTestSuiteRunner(DjangoTestSuiteRunner): # Getting and storing the original values of INSTALLED_APPS and # the ROOT_URLCONF. - self.old_installed = settings.INSTALLED_APPS - self.old_root_urlconf = settings.ROOT_URLCONF + self.old_installed = getattr(settings, 'INSTALLED_APPS', None) + self.old_root_urlconf = getattr(settings, 'ROOT_URLCONF', None) + self.old_site_id = getattr(settings, 'SITE_ID', None) # Tests that require use of a spatial database (e.g., creation of models) self.geo_apps = ['geoapp', 'relatedapp'] @@ -62,11 +63,13 @@ class GeoDjangoTestSuiteRunner(DjangoTestSuiteRunner): # Setting the URLs. settings.ROOT_URLCONF = 'django.contrib.gis.tests.urls' + settings.SITE_ID = 1 def teardown_test_environment(self, **kwargs): super(GeoDjangoTestSuiteRunner, self).teardown_test_environment(**kwargs) settings.INSTALLED_APPS = self.old_installed settings.ROOT_URLCONF = self.old_root_urlconf + settings.SITE_ID = self.old_site_id def build_suite(self, test_labels, extra_tests=None, **kwargs): """ |
