Refs #27788 -- Removed Oracle 11 workarounds in GIS tests.
This commit is contained in:
parent
bf0dff4bed
commit
6f913c0305
|
@ -104,20 +104,10 @@ class DistanceTest(TestCase):
|
||||||
# Retrieving the cities within a 20km 'donut' w/a 7km radius 'hole'
|
# Retrieving the cities within a 20km 'donut' w/a 7km radius 'hole'
|
||||||
# (thus, Houston and Southside place will be excluded as tested in
|
# (thus, Houston and Southside place will be excluded as tested in
|
||||||
# the `test02_dwithin` above).
|
# the `test02_dwithin` above).
|
||||||
qs1 = SouthTexasCity.objects.filter(point__distance_gte=(self.stx_pnt, D(km=7))).filter(
|
for model in [SouthTexasCity, SouthTexasCityFt]:
|
||||||
|
qs = model.objects.filter(point__distance_gte=(self.stx_pnt, D(km=7))).filter(
|
||||||
point__distance_lte=(self.stx_pnt, D(km=20)),
|
point__distance_lte=(self.stx_pnt, D(km=20)),
|
||||||
)
|
)
|
||||||
|
|
||||||
# Oracle 11 incorrectly thinks it is not projected.
|
|
||||||
if oracle:
|
|
||||||
dist_qs = (qs1,)
|
|
||||||
else:
|
|
||||||
qs2 = SouthTexasCityFt.objects.filter(point__distance_gte=(self.stx_pnt, D(km=7))).filter(
|
|
||||||
point__distance_lte=(self.stx_pnt, D(km=20)),
|
|
||||||
)
|
|
||||||
dist_qs = (qs1, qs2)
|
|
||||||
|
|
||||||
for qs in dist_qs:
|
|
||||||
cities = self.get_names(qs)
|
cities = self.get_names(qs)
|
||||||
self.assertEqual(cities, ['Bellaire', 'Pearland', 'West University Place'])
|
self.assertEqual(cities, ['Bellaire', 'Pearland', 'West University Place'])
|
||||||
|
|
||||||
|
@ -293,8 +283,6 @@ class DistanceFunctionsTests(TestCase):
|
||||||
70870.188967, 165337.758878, 139196.085105]
|
70870.188967, 165337.758878, 139196.085105]
|
||||||
# SELECT ST_Distance(point, ST_Transform(ST_GeomFromText('POINT(-96.876369 29.905320)', 4326), 2278))
|
# SELECT ST_Distance(point, ST_Transform(ST_GeomFromText('POINT(-96.876369 29.905320)', 4326), 2278))
|
||||||
# FROM distapp_southtexascityft;
|
# FROM distapp_southtexascityft;
|
||||||
# Oracle 11 thinks this is not a projected coordinate system, so it's
|
|
||||||
# not tested.
|
|
||||||
ft_distances = [482528.79154625, 458103.408123001, 462231.860397575,
|
ft_distances = [482528.79154625, 458103.408123001, 462231.860397575,
|
||||||
455411.438904354, 519386.252102563, 696139.009211594,
|
455411.438904354, 519386.252102563, 696139.009211594,
|
||||||
232513.278304279, 542445.630586414, 456679.155883207]
|
232513.278304279, 542445.630586414, 456679.155883207]
|
||||||
|
@ -302,9 +290,6 @@ class DistanceFunctionsTests(TestCase):
|
||||||
# Testing using different variations of parameters and using models
|
# Testing using different variations of parameters and using models
|
||||||
# with different projected coordinate systems.
|
# with different projected coordinate systems.
|
||||||
dist1 = SouthTexasCity.objects.annotate(distance=Distance('point', lagrange)).order_by('id')
|
dist1 = SouthTexasCity.objects.annotate(distance=Distance('point', lagrange)).order_by('id')
|
||||||
if oracle:
|
|
||||||
dist_qs = [dist1]
|
|
||||||
else:
|
|
||||||
dist2 = SouthTexasCityFt.objects.annotate(distance=Distance('point', lagrange)).order_by('id')
|
dist2 = SouthTexasCityFt.objects.annotate(distance=Distance('point', lagrange)).order_by('id')
|
||||||
dist_qs = [dist1, dist2]
|
dist_qs = [dist1, dist2]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue