diff options
| author | Tim Graham <timograham@gmail.com> | 2014-09-19 10:03:38 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-09-19 14:38:58 -0400 |
| commit | 7add30df01f46ec91b8da411620a0f1a117c1b73 (patch) | |
| tree | f4a202c09d12ca97a660d76ad898179b7535f89a | |
| parent | 9d30412a5ad1c72b3d319b4c2bceacb53a0ff1da (diff) | |
Made a GIS test work on Oracle.
Thanks Josh Smeaton and Claude Paroz for advice.
| -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 88c9435a3c..f4699aed8f 100644 --- a/django/contrib/gis/tests/geoapp/tests.py +++ b/django/contrib/gis/tests/geoapp/tests.py @@ -196,8 +196,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.assertIsInstance(cities2[0].point, Point) |
