diff options
| author | Tim Graham <timograham@gmail.com> | 2014-09-19 10:03:38 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-09-22 13:46:28 -0400 |
| commit | dd7346ed1daf30ee37517057b58900bd10ba978b (patch) | |
| tree | 655c556752f64629afe9b5b81c0e0bc91c201de5 | |
| parent | 2376319ce089cb3d5484fc1d9861f81a80d6abc4 (diff) | |
[1.6.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 617d92b368..9d4161a907 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.assertTrue(isinstance(cities2[0].point, Point)) |
