From 9ab798a8d8911a431bcb28b0bd82e391e879077a Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Sun, 2 Feb 2014 20:03:23 +0100 Subject: [PATCH] Fixed #21930 -- Only import add_srs_entry if GDAL is installed Fixed regression introduced by fabc678f93. Thanks Michael Manfre for the report. --- django/contrib/gis/tests/test_spatialrefsys.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/django/contrib/gis/tests/test_spatialrefsys.py b/django/contrib/gis/tests/test_spatialrefsys.py index ec4f76c610..98e9d47699 100644 --- a/django/contrib/gis/tests/test_spatialrefsys.py +++ b/django/contrib/gis/tests/test_spatialrefsys.py @@ -3,7 +3,6 @@ import unittest from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.tests.utils import (no_mysql, oracle, postgis, spatialite, HAS_SPATIALREFSYS, SpatialRefSys) -from django.contrib.gis.utils import add_srs_entry from django.db import connection from django.utils import six @@ -109,6 +108,8 @@ class SpatialRefSysTest(unittest.TestCase): Test adding a new entry in the SpatialRefSys model using the add_srs_entry utility. """ + from django.contrib.gis.utils import add_srs_entry + add_srs_entry(900913) self.assertTrue( SpatialRefSys.objects.filter(srid=900913).exists()