def test_raw_sql_query(self):
        "Testing raw SQL query."
        cities1 = City.objects.all()
        # Only PostGIS would support a 'select *' query because of its recognized
        # HEXEWKB format for geometry fields
        as_text = 'ST_AsText' if postgis else 'asText'
        cities2 = City.objects.raw('select id, name, %s(point) from geoapp_city' % as_text)
        self.assertEqual(len(cities1), len(list(cities2)))
        self.assertTrue(isinstance(cities2[0].point, Point))
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/contrib/gis/tests/geoapp/tests.py/GeoModelTest.test_raw_sql_query/original