summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2017-03-14 04:21:20 +0500
committerTim Graham <timograham@gmail.com>2017-03-13 19:21:20 -0400
commit6f913c03057acb00249f31e823f8ca2274fe74dc (patch)
tree9eba94c33d72f9cd69d2a5068f1c112fb6d2efa6
parentbf0dff4bed5ebb4f922829e5f7e8da5ec51f2a1c (diff)
Refs #27788 -- Removed Oracle 11 workarounds in GIS tests.
-rw-r--r--tests/gis_tests/distapp/tests.py23
1 files changed, 4 insertions, 19 deletions
diff --git a/tests/gis_tests/distapp/tests.py b/tests/gis_tests/distapp/tests.py
index 9d67b7b013..5f3dcb8f44 100644
--- a/tests/gis_tests/distapp/tests.py
+++ b/tests/gis_tests/distapp/tests.py
@@ -104,20 +104,10 @@ class DistanceTest(TestCase):
# Retrieving the cities within a 20km 'donut' w/a 7km radius 'hole'
# (thus, Houston and Southside place will be excluded as tested in
# the `test02_dwithin` above).
- qs1 = SouthTexasCity.objects.filter(point__distance_gte=(self.stx_pnt, D(km=7))).filter(
- 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(
+ 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)),
)
- dist_qs = (qs1, qs2)
-
- for qs in dist_qs:
cities = self.get_names(qs)
self.assertEqual(cities, ['Bellaire', 'Pearland', 'West University Place'])
@@ -293,8 +283,6 @@ class DistanceFunctionsTests(TestCase):
70870.188967, 165337.758878, 139196.085105]
# SELECT ST_Distance(point, ST_Transform(ST_GeomFromText('POINT(-96.876369 29.905320)', 4326), 2278))
# 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,
455411.438904354, 519386.252102563, 696139.009211594,
232513.278304279, 542445.630586414, 456679.155883207]
@@ -302,11 +290,8 @@ class DistanceFunctionsTests(TestCase):
# Testing using different variations of parameters and using models
# with different projected coordinate systems.
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')
- dist_qs = [dist1, dist2]
+ dist2 = SouthTexasCityFt.objects.annotate(distance=Distance('point', lagrange)).order_by('id')
+ dist_qs = [dist1, dist2]
# Original query done on PostGIS, have to adjust AlmostEqual tolerance
# for Oracle.