mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #26753 -- Made GDAL a required dependency for contrib.gis
Thanks Tim Graham for the review.
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import re
|
||||
import unittest
|
||||
|
||||
from django.contrib.gis.gdal import HAS_GDAL
|
||||
from django.test import mock, skipUnlessDBFeature
|
||||
from django.test import skipUnlessDBFeature
|
||||
from django.utils import six
|
||||
|
||||
from .utils import SpatialRefSys, oracle, postgis, spatialite
|
||||
@@ -51,7 +50,6 @@ test_srs = ({
|
||||
})
|
||||
|
||||
|
||||
@unittest.skipUnless(HAS_GDAL, "SpatialRefSysTest needs gdal support")
|
||||
@skipUnlessDBFeature("has_spatialrefsys_table")
|
||||
class SpatialRefSysTest(unittest.TestCase):
|
||||
|
||||
@@ -61,13 +59,6 @@ class SpatialRefSysTest(unittest.TestCase):
|
||||
self.assertEqual(unit_name, 'degree')
|
||||
self.assertAlmostEqual(unit, 0.01745329251994328)
|
||||
|
||||
@mock.patch('django.contrib.gis.gdal.HAS_GDAL', False)
|
||||
def test_get_units_without_gdal(self):
|
||||
epsg_4326 = next(f for f in test_srs if f['srid'] == 4326)
|
||||
unit, unit_name = SpatialRefSys().get_units(epsg_4326['wkt'])
|
||||
self.assertEqual(unit_name, 'degree')
|
||||
self.assertAlmostEqual(unit, 0.01745329251994328)
|
||||
|
||||
def test_retrieve(self):
|
||||
"""
|
||||
Test retrieval of SpatialRefSys model objects.
|
||||
|
||||
Reference in New Issue
Block a user