summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-09-30 09:07:10 -0400
committerTim Graham <timograham@gmail.com>2016-10-01 09:25:07 -0400
commitf0b55f160f908b1944e98fcf22289fde2b2f67a0 (patch)
treeb311f2b058e10a806f6445e69079d6e2a67d8abe
parent108613eab7a96bcf7c5568e30066e0316aac132e (diff)
[1.9.x] Relaxed a test for PostGIS 2.3.
Backport of 79c91070e5797f647347c2f8bdfc4c7a0f835fb3 from master
-rw-r--r--tests/gis_tests/geoapp/test_functions.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/gis_tests/geoapp/test_functions.py b/tests/gis_tests/geoapp/test_functions.py
index 13b49db1b5..841c7d503a 100644
--- a/tests/gis_tests/geoapp/test_functions.py
+++ b/tests/gis_tests/geoapp/test_functions.py
@@ -153,13 +153,16 @@ class GISFunctionsTests(TestCase):
@skipUnlessDBFeature("has_BoundingCircle_function")
def test_bounding_circle(self):
+ # The weak precision in the assertions is because the BoundingCircle
+ # calculation changed on PostGIS 2.3.
qs = Country.objects.annotate(circle=functions.BoundingCircle('mpoly')).order_by('name')
- self.assertAlmostEqual(qs[0].circle.area, 168.89, 2)
- self.assertAlmostEqual(qs[1].circle.area, 135.95, 2)
+ self.assertAlmostEqual(qs[0].circle.area, 169, 0)
+ self.assertAlmostEqual(qs[1].circle.area, 136, 0)
qs = Country.objects.annotate(circle=functions.BoundingCircle('mpoly', num_seg=12)).order_by('name')
- self.assertAlmostEqual(qs[0].circle.area, 168.44, 2)
- self.assertAlmostEqual(qs[1].circle.area, 135.59, 2)
+ self.assertGreater(qs[0].circle.area, 168.4, 0)
+ self.assertLess(qs[0].circle.area, 169.5, 0)
+ self.assertAlmostEqual(qs[1].circle.area, 136, 0)
@skipUnlessDBFeature("has_Centroid_function")
def test_centroid(self):