'Testing raw SQL query.'

def test_raw_sql_query(self):

    cities1 = City.objects.all()
    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))
