From 6f913c03057acb00249f31e823f8ca2274fe74dc Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Tue, 14 Mar 2017 04:21:20 +0500 Subject: [PATCH] Refs #27788 -- Removed Oracle 11 workarounds in GIS tests. --- tests/gis_tests/distapp/tests.py | 23 ++++------------------- 1 file 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.