Permalink
Browse files

[1.6.x] Made a GIS test work on Oracle.

Thanks Josh Smeaton and Claude Paroz for advice.

Backport of 7add30d from master
  • Loading branch information...
timgraham committed Sep 19, 2014
1 parent 2376319 commit dd7346ed1daf30ee37517057b58900bd10ba978b
Showing with 4 additions and 2 deletions.
  1. +4 −2 django/contrib/gis/tests/geoapp/tests.py
@@ -196,8 +196,10 @@ def test_raw_sql_query(self):
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)
+ 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.assertTrue(isinstance(cities2[0].point, Point))

0 comments on commit dd7346e

Please sign in to comment.