'Testing raw SQL query.'

def test_raw_sql_query(self):

    cities1 = City.objects.all()
    as_text = ('ST_AsText(%s)' if postgis else connection.ops.select)
    cities2 = City.objects.raw((('select    id,    name,    %s    from    geoapp_city' % as_text) % 'point'))
    self.assertEqual(len(cities1), len(list(cities2)))
    self.assertIsInstance(cities2[0].point, Point)
