

def test_band_delete_nodata(self):
    rsmem = GDALRaster({
        'srid': 4326,
        'width': 1,
        'height': 1,
        'bands': [{
            'data': [0],
            'nodata_value': 1,
        }],
    })
    if (GDAL_VERSION < (2, 1)):
        msg = 'GDAL >= 2.1 required to delete nodata values.'
        with self.assertRaisesMessage(ValueError, msg):
            rsmem.bands[0].nodata_value = None
    else:
        rsmem.bands[0].nodata_value = None
        self.assertIsNone(rsmem.bands[0].nodata_value)

dataset/ETHPy150Open django/django/tests/gis_tests/gdal_tests/test_raster.py GDALBandTests.test_band_delete_nodata/original