[1.9.x] Relaxed a test for PostGIS 2.3.
Backport of 79c91070e5797f647347c2f8bdfc4c7a0f835fb3 from master
This commit is contained in:
parent
108613eab7
commit
f0b55f160f
@ -153,13 +153,16 @@ class GISFunctionsTests(TestCase):
|
|||||||
|
|
||||||
@skipUnlessDBFeature("has_BoundingCircle_function")
|
@skipUnlessDBFeature("has_BoundingCircle_function")
|
||||||
def test_bounding_circle(self):
|
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')
|
qs = Country.objects.annotate(circle=functions.BoundingCircle('mpoly')).order_by('name')
|
||||||
self.assertAlmostEqual(qs[0].circle.area, 168.89, 2)
|
self.assertAlmostEqual(qs[0].circle.area, 169, 0)
|
||||||
self.assertAlmostEqual(qs[1].circle.area, 135.95, 2)
|
self.assertAlmostEqual(qs[1].circle.area, 136, 0)
|
||||||
|
|
||||||
qs = Country.objects.annotate(circle=functions.BoundingCircle('mpoly', num_seg=12)).order_by('name')
|
qs = Country.objects.annotate(circle=functions.BoundingCircle('mpoly', num_seg=12)).order_by('name')
|
||||||
self.assertAlmostEqual(qs[0].circle.area, 168.44, 2)
|
self.assertGreater(qs[0].circle.area, 168.4, 0)
|
||||||
self.assertAlmostEqual(qs[1].circle.area, 135.59, 2)
|
self.assertLess(qs[0].circle.area, 169.5, 0)
|
||||||
|
self.assertAlmostEqual(qs[1].circle.area, 136, 0)
|
||||||
|
|
||||||
@skipUnlessDBFeature("has_Centroid_function")
|
@skipUnlessDBFeature("has_Centroid_function")
|
||||||
def test_centroid(self):
|
def test_centroid(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user