Skip to content

Commit

Permalink
[1.9.x] Relaxed a test for PostGIS 2.3.
Browse files Browse the repository at this point in the history
Backport of 79c9107 from master
  • Loading branch information
timgraham committed Oct 1, 2016
1 parent 108613e commit f0b55f1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/gis_tests/geoapp/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,16 @@ def test_assvg(self):

@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):
Expand Down

0 comments on commit f0b55f1

Please sign in to comment.