mirror of
https://github.com/django/django.git
synced 2025-03-14 03:10:45 +00:00
[1.6.x] Made a GIS test work on Oracle.
Thanks Josh Smeaton and Claude Paroz for advice. Backport of 7add30df01 from master
This commit is contained in:
parent
2376319ce0
commit
dd7346ed1d
@ -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))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user