Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
  • Loading branch information...
commit 7592d685411b35b0878b88c57df80eaeff22186f 1 parent d4bb831
Justin Bronn authored November 20, 2010

Showing 1 changed file with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. 7  django/contrib/gis/tests/__init__.py
7  django/contrib/gis/tests/__init__.py
@@ -30,8 +30,9 @@ def setup_test_environment(self, **kwargs):
30 30
 
31 31
         # Getting and storing the original values of INSTALLED_APPS and
32 32
         # the ROOT_URLCONF.
33  
-        self.old_installed = settings.INSTALLED_APPS
34  
-        self.old_root_urlconf = settings.ROOT_URLCONF
  33
+        self.old_installed = getattr(settings, 'INSTALLED_APPS', None)
  34
+        self.old_root_urlconf = getattr(settings, 'ROOT_URLCONF', None)
  35
+        self.old_site_id = getattr(settings, 'SITE_ID', None)
35 36
 
36 37
         # Tests that require use of a spatial database (e.g., creation of models)
37 38
         self.geo_apps = ['geoapp', 'relatedapp']
@@ -62,11 +63,13 @@ def setup_test_environment(self, **kwargs):
62 63
 
63 64
         # Setting the URLs.
64 65
         settings.ROOT_URLCONF = 'django.contrib.gis.tests.urls'
  66
+        settings.SITE_ID = 1
65 67
 
66 68
     def teardown_test_environment(self, **kwargs):
67 69
         super(GeoDjangoTestSuiteRunner, self).teardown_test_environment(**kwargs)
68 70
         settings.INSTALLED_APPS = self.old_installed
69 71
         settings.ROOT_URLCONF = self.old_root_urlconf
  72
+        settings.SITE_ID = self.old_site_id
70 73
 
71 74
     def build_suite(self, test_labels, extra_tests=None, **kwargs):
72 75
         """

0 notes on commit 7592d68

Please sign in to comment.
Something went wrong with that request. Please try again.