'Testing getting OSR objects from SpatialRefSys model objects.'

@no_mysql
def test02_osr(self):

    for sd in test_srs:
        sr = SpatialRefSys.objects.get(srid=sd['srid'])
        self.assertEqual(True, sr.spheroid.startswith(sd['spheroid']))
        self.assertEqual(sd['geographic'], sr.geographic)
        self.assertEqual(sd['projected'], sr.projected)
        if (not (spatialite and (not sd['spatialite']))):
            self.assertEqual(True, sr.name.startswith(sd['name']))
        if (postgis or spatialite):
            srs = sr.srs
            if (GDAL_VERSION <= (1, 8)):
                self.assertEqual(sd['proj4'], srs.proj4)
            if (not spatialite):
                if (connection.ops.spatial_version >= (1, 4, 0)):
                    srtext = sd['srtext14']
                else:
                    srtext = sd['srtext']
                self.assertEqual(srtext, srs.wkt)
