'Test RasterField through a test model.'

def test_model_creation(self):

    r = RasterModel.objects.create(rast=JSON_RASTER)
    r.refresh_from_db()
    self.assertEqual((5, 5), (r.rast.width, r.rast.height))
    self.assertEqual([0.0, (-1.0), 0.0, 0.0, 0.0, 1.0], r.rast.geotransform)
    self.assertIsNone(r.rast.bands[0].nodata_value)
    self.assertEqual(r.rast.srs.srid, 4326)
    band = r.rast.bands[0].data()
    if numpy:
        band = band.flatten().tolist()
    self.assertEqual([0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0], band)
