'Testing the transform() GeoManager method.'

@no_mysql
def test04_transform(self):

    htown = fromstr('POINT(1947516.83115183    6322297.06040572)', srid=3084)
    ptown = fromstr('POINT(992363.390841912    481455.395105533)', srid=2774)
    prec = 3
    if (not oracle):
        h = City.objects.transform(htown.srid).get(name='Houston')
        self.assertEqual(3084, h.point.srid)
        self.assertAlmostEqual(htown.x, h.point.x, prec)
        self.assertAlmostEqual(htown.y, h.point.y, prec)
    p1 = City.objects.transform(ptown.srid, field_name='point').get(name='Pueblo')
    p2 = City.objects.transform(srid=ptown.srid).get(name='Pueblo')
    for p in [p1, p2]:
        self.assertEqual(2774, p.point.srid)
        self.assertAlmostEqual(ptown.x, p.point.x, prec)
        self.assertAlmostEqual(ptown.y, p.point.y, prec)
