diff options
| author | Tim Graham <timograham@gmail.com> | 2016-09-30 09:07:10 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-10-01 09:12:53 -0400 |
| commit | bade924c036b2114b7265e7a8ef5538a4dee32d0 (patch) | |
| tree | 69d68043a93e4d82818687d9171882cc4f7960af /tests | |
| parent | bfc9c727256ded75dd9438167d6549b195361a0d (diff) | |
[1.10.x] Confirmed support for PostGIS 2.3.
Backport of 79c91070e5797f647347c2f8bdfc4c7a0f835fb3 from master
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/gis_tests/geoapp/test_functions.py | 11 |
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 1a1727dbbc..0e5f2ee693 100644 --- a/tests/gis_tests/geoapp/test_functions.py +++ b/tests/gis_tests/geoapp/test_functions.py @@ -147,13 +147,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): |
