'Testing automatic transform for lookups and inserts.'

@no_mysql
def test11_lookup_insert_transform(self):

    sa_4326 = 'POINT    (-98.493183    29.424170)'
    wgs_pnt = fromstr(sa_4326, srid=4326)
    if oracle:
        nad_wkt = 'POINT    (300662.034646583    5416427.45974934)'
        nad_srid = 41157
    else:
        nad_wkt = 'POINT    (1645978.362408288754523    6276356.025927528738976)'
        nad_srid = 3084
    nad_pnt = fromstr(nad_wkt, srid=nad_srid)
    if oracle:
        tx = Country.objects.get(mpoly__contains=nad_pnt)
    else:
        tx = Country.objects.get(mpoly__intersects=nad_pnt)
    self.assertEqual('Texas', tx.name)
    sa = City.objects.create(name='San    Antonio', point=nad_pnt)
    sa = City.objects.get(name='San    Antonio')
    self.assertAlmostEqual(wgs_pnt.x, sa.point.x, 6)
    self.assertAlmostEqual(wgs_pnt.y, sa.point.y, 6)
    if (not spatialite):
        m1 = MinusOneSRID(geom=Point(17, 23, srid=4326))
        m1.save()
        self.assertEqual((-1), m1.geom.srid)
