diff options
| author | Tim Graham <timograham@gmail.com> | 2016-09-30 09:07:10 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-09-30 10:00:04 -0400 |
| commit | 79c91070e5797f647347c2f8bdfc4c7a0f835fb3 (patch) | |
| tree | 513b406510a41ae0c0da3aab6ac64405811dfb72 /tests | |
| parent | cc282fa731dd4a427fb4e2aa6fb0e6763e44a72d (diff) | |
Confirmed support for PostGIS 2.3.
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): |
