Loading django/contrib/gis/tests/__init__.py +4 −8 Original line number Diff line number Diff line Loading @@ -2,6 +2,10 @@ from django.conf import settings from django.test.simple import build_suite, DjangoTestSuiteRunner from django.utils import unittest from .test_geoforms import GeometryFieldTest from .test_measure import DistanceTest, AreaTest from .test_spatialrefsys import SpatialRefSysTest def geo_apps(namespace=True, runtests=False): """ Loading Loading @@ -54,20 +58,12 @@ def geodjango_suite(apps=True): from django.contrib.gis.geos import tests as geos_tests suite.addTest(geos_tests.suite()) # Adding the measurment tests. from django.contrib.gis.tests import test_measure suite.addTest(test_measure.suite()) # Adding GDAL tests, and any test suite that depends on GDAL, to the # suite if GDAL is available. from django.contrib.gis.gdal import HAS_GDAL if HAS_GDAL: from django.contrib.gis.gdal import tests as gdal_tests suite.addTest(gdal_tests.suite()) from django.contrib.gis.tests import test_spatialrefsys, test_geoforms suite.addTest(test_spatialrefsys.suite()) suite.addTest(test_geoforms.suite()) else: sys.stderr.write('GDAL not available - no tests requiring GDAL will be run.\n') Loading django/contrib/gis/tests/test_geoforms.py +2 −0 Original line number Diff line number Diff line from django.forms import ValidationError from django.contrib.gis import forms from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.geos import GEOSGeometry from django.utils import unittest @unittest.skipUnless(HAS_GDAL, "GeometryFieldTest needs gdal support") class GeometryFieldTest(unittest.TestCase): def test00_init(self): Loading django/contrib/gis/tests/test_spatialrefsys.py +3 −1 Original line number Diff line number Diff line from django.db import connection from django.contrib.gis.gdal import GDAL_VERSION from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.tests.utils import no_mysql, oracle, postgis, spatialite from django.utils import unittest Loading Loading @@ -35,6 +35,7 @@ elif postgis: elif spatialite: from django.contrib.gis.db.backends.spatialite.models import SpatialRefSys @unittest.skipUnless(HAS_GDAL, "SpatialRefSysTest needs gdal support") class SpatialRefSysTest(unittest.TestCase): @no_mysql Loading Loading @@ -65,6 +66,7 @@ class SpatialRefSysTest(unittest.TestCase): @no_mysql def test02_osr(self): "Testing getting OSR objects from SpatialRefSys model objects." from django.contrib.gis.gdal import GDAL_VERSION for sd in test_srs: sr = SpatialRefSys.objects.get(srid=sd['srid']) self.assertEqual(True, sr.spheroid.startswith(sd['spheroid'])) Loading Loading
django/contrib/gis/tests/__init__.py +4 −8 Original line number Diff line number Diff line Loading @@ -2,6 +2,10 @@ from django.conf import settings from django.test.simple import build_suite, DjangoTestSuiteRunner from django.utils import unittest from .test_geoforms import GeometryFieldTest from .test_measure import DistanceTest, AreaTest from .test_spatialrefsys import SpatialRefSysTest def geo_apps(namespace=True, runtests=False): """ Loading Loading @@ -54,20 +58,12 @@ def geodjango_suite(apps=True): from django.contrib.gis.geos import tests as geos_tests suite.addTest(geos_tests.suite()) # Adding the measurment tests. from django.contrib.gis.tests import test_measure suite.addTest(test_measure.suite()) # Adding GDAL tests, and any test suite that depends on GDAL, to the # suite if GDAL is available. from django.contrib.gis.gdal import HAS_GDAL if HAS_GDAL: from django.contrib.gis.gdal import tests as gdal_tests suite.addTest(gdal_tests.suite()) from django.contrib.gis.tests import test_spatialrefsys, test_geoforms suite.addTest(test_spatialrefsys.suite()) suite.addTest(test_geoforms.suite()) else: sys.stderr.write('GDAL not available - no tests requiring GDAL will be run.\n') Loading
django/contrib/gis/tests/test_geoforms.py +2 −0 Original line number Diff line number Diff line from django.forms import ValidationError from django.contrib.gis import forms from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.geos import GEOSGeometry from django.utils import unittest @unittest.skipUnless(HAS_GDAL, "GeometryFieldTest needs gdal support") class GeometryFieldTest(unittest.TestCase): def test00_init(self): Loading
django/contrib/gis/tests/test_spatialrefsys.py +3 −1 Original line number Diff line number Diff line from django.db import connection from django.contrib.gis.gdal import GDAL_VERSION from django.contrib.gis.gdal import HAS_GDAL from django.contrib.gis.tests.utils import no_mysql, oracle, postgis, spatialite from django.utils import unittest Loading Loading @@ -35,6 +35,7 @@ elif postgis: elif spatialite: from django.contrib.gis.db.backends.spatialite.models import SpatialRefSys @unittest.skipUnless(HAS_GDAL, "SpatialRefSysTest needs gdal support") class SpatialRefSysTest(unittest.TestCase): @no_mysql Loading Loading @@ -65,6 +66,7 @@ class SpatialRefSysTest(unittest.TestCase): @no_mysql def test02_osr(self): "Testing getting OSR objects from SpatialRefSys model objects." from django.contrib.gis.gdal import GDAL_VERSION for sd in test_srs: sr = SpatialRefSys.objects.get(srid=sd['srid']) self.assertEqual(True, sr.spheroid.startswith(sd['spheroid'])) Loading