diff options
| author | Tim Graham <timograham@gmail.com> | 2014-09-19 10:03:38 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-09-19 15:05:56 -0400 |
| commit | b287676739849aae397969aef4e0e09e88cf8bdb (patch) | |
| tree | ad6db46a9807162a2d954d05cf13f7d8530f87bb | |
| parent | 0f52bf7c96e0b407a381bc4596f34cd01065f90d (diff) | |
[1.7.x] Made a GIS test work on Oracle.
Thanks Josh Smeaton and Claude Paroz for advice.
Backport of 7add30df01 from master
| -rw-r--r-- | django/contrib/gis/tests/geoapp/tests.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/django/contrib/gis/tests/geoapp/tests.py b/django/contrib/gis/tests/geoapp/tests.py index 8456ca1718..97d395af4c 100644 --- a/django/contrib/gis/tests/geoapp/tests.py +++ b/django/contrib/gis/tests/geoapp/tests.py @@ -198,8 +198,10 @@ class GeoModelTest(TestCase): 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)) |
