From 9358da704ea9ba55f22df912e47b54eb85d5c97e Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Sat, 7 Mar 2020 21:34:33 +0100 Subject: [PATCH] Refs #30489 -- Fixed RasterFieldTest.test_deserialize_with_pixeltype_flags() when run without numpy. --- tests/gis_tests/rasterapp/test_rasterfield.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/gis_tests/rasterapp/test_rasterfield.py b/tests/gis_tests/rasterapp/test_rasterfield.py index 794c67ec613..b9467f1452c 100644 --- a/tests/gis_tests/rasterapp/test_rasterfield.py +++ b/tests/gis_tests/rasterapp/test_rasterfield.py @@ -68,7 +68,10 @@ class RasterFieldTest(TransactionTestCase): rast=Func(F('rast'), function='ST_SetBandIsNoData'), ) r.refresh_from_db() - self.assertEqual(r.rast.bands[0].data(), [[no_data]]) + band = r.rast.bands[0].data() + if numpy: + band = band.flatten().tolist() + self.assertEqual(band, [no_data]) self.assertEqual(r.rast.bands[0].nodata_value, no_data) def test_model_creation(self):