mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #28558 -- Simplified code to remove OGRIndexError.
The test is a regression for refs #4740 to show that the original fix of
OGRIndexError is no longer needed.
This is similar to the removal of GEOSIndexError in
197b187810
.
This commit is contained in:
parent
feb1a0a692
commit
9397d3add4
8 changed files with 34 additions and 65 deletions
|
@ -4,7 +4,6 @@ import unittest
|
|||
|
||||
from django.contrib.gis.gdal import (
|
||||
GDAL_VERSION, DataSource, Envelope, GDALException, OGRGeometry,
|
||||
OGRIndexError,
|
||||
)
|
||||
from django.contrib.gis.gdal.field import OFTInteger, OFTReal, OFTString
|
||||
|
||||
|
@ -84,7 +83,7 @@ class DataSourceTest(unittest.TestCase):
|
|||
self.assertEqual(source.driver, str(ds.driver))
|
||||
|
||||
# Making sure indexing works
|
||||
with self.assertRaises(OGRIndexError):
|
||||
with self.assertRaises(IndexError):
|
||||
ds[len(ds)]
|
||||
|
||||
def test02_invalid_shp(self):
|
||||
|
@ -120,9 +119,9 @@ class DataSourceTest(unittest.TestCase):
|
|||
self.assertIn(f, source.fields)
|
||||
|
||||
# Negative FIDs are not allowed.
|
||||
with self.assertRaises(OGRIndexError):
|
||||
with self.assertRaises(IndexError):
|
||||
layer.__getitem__(-1)
|
||||
with self.assertRaises(OGRIndexError):
|
||||
with self.assertRaises(IndexError):
|
||||
layer.__getitem__(50000)
|
||||
|
||||
if hasattr(source, 'field_values'):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue