diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-09-15 11:56:39 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-09-15 12:02:28 +0200 |
| commit | 65793d714ca6b03d2cd0fcfeec54652396f7ab48 (patch) | |
| tree | 218c118694db8a513d13f08262d2db6b5a300693 /django | |
| parent | abfba3bb65c9a28ca3756ec5d091e2e8561fc450 (diff) | |
Used ST_AsText for testing PostGIS raw query
AsText will not be supported in further versions of PostGIS (>=2).
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/gis/tests/geoapp/tests.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/django/contrib/gis/tests/geoapp/tests.py b/django/contrib/gis/tests/geoapp/tests.py index fbe30e8841..cd3cec3074 100644 --- a/django/contrib/gis/tests/geoapp/tests.py +++ b/django/contrib/gis/tests/geoapp/tests.py @@ -191,7 +191,8 @@ class GeoModelTest(TestCase): cities1 = City.objects.all() # Only PostGIS would support a 'select *' query because of its recognized # HEXEWKB format for geometry fields - cities2 = City.objects.raw('select id, name, asText(point) from geoapp_city') + as_text = 'ST_AsText' if postgis else 'asText' + cities2 = City.objects.raw('select id, name, %s(point) from geoapp_city' % as_text) self.assertEqual(len(cities1), len(list(cities2))) self.assertTrue(isinstance(cities2[0].point, Point)) |
