'Test getting OSR objects from SpatialRefSys model objects.'

def test_osr(self):

    for sd in test_srs:
        sr = SpatialRefSys.objects.get(srid=sd['srid'])
        self.assertTrue(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.assertTrue(sr.name.startswith(sd['name']))
        if (postgis or spatialite):
            srs = sr.srs
            self.assertRegex(srs.proj4, sd['proj4_re'])
            self.assertTrue(srs.wkt.startswith(sd['srtext']))
