Browse files

Moved imports so that other tests may be imported without specifying …

…Django settings.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent b04faa3 commit 96becf2458c1180ba3249614bcd758a79b12ee36 @jbronn jbronn committed Sep 15, 2008
Showing with 9 additions and 6 deletions.
  1. +9 −6 django/contrib/gis/tests/
@@ -1,18 +1,13 @@
import sys, unittest
-from django.conf import settings
-from django.db import connection
-from django.db.models import get_app, get_apps, loading
-from django.test.simple import build_suite, build_test
-from django.test.utils import setup_test_environment, teardown_test_environment
def geo_suite():
Builds a test suite for the GIS package. This is not named
`suite` so it will not interfere with the Django test suite (since
spatial database tables are required to execute these tests on
some backends).
+ from django.conf import settings
from django.contrib.gis.tests.utils import mysql, oracle, postgis
from django.contrib.gis.gdal import HAS_GDAL
from django.contrib.gis.utils import HAS_GEOIP
@@ -62,6 +57,8 @@ def run_gis_tests(test_labels, **kwargs):
GeoDjango test suite. This must be done as a database superuser for
PostGIS, so read the docstring in `run_test()` below for more details.
+ from django.conf import settings
+ from django.db.models import loading
from django.contrib.gis.tests.utils import mysql
# Getting initial values.
@@ -160,6 +157,12 @@ def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[], suite=
Finally, the tests may be run by invoking `./ test`.
+ from django.conf import settings
+ from django.db import connection
+ from django.db.models import get_app, get_apps
+ from django.test.simple import build_suite, build_test
+ from django.test.utils import setup_test_environment, teardown_test_environment
# The `create_spatial_db` routine abstracts away all the steps needed
# to properly construct a spatial database for the backend.
from django.contrib.gis.db.backend import create_spatial_db

0 comments on commit 96becf2

Please sign in to comment.