'Testing the `transform` GeoQuerySet method on related geographic models.'

@no_mysql
def test03_transform_related(self):

    tol = 0
    def check_pnt(ref, pnt):
        self.assertAlmostEqual(ref.x, pnt.x, tol)
        self.assertAlmostEqual(ref.y, pnt.y, tol)
        self.assertEqual(ref.srid, pnt.srid)
    transformed = (('Kecksburg', 2272, 'POINT(1490553.98959621    314792.131023984)'), ('Roswell', 2257, 'POINT(481902.189077221    868477.766629735)'), ('Aurora', 2276, 'POINT(2269923.2484839    7069381.28722222)'))
    for (name, srid, wkt) in transformed:
        qs = list(City.objects.filter(name=name).transform(srid, field_name='location__point'))
        check_pnt(GEOSGeometry(wkt, srid), qs[0].location.point)
