def test_radius_for_polygon(self):
"""
Tests the function calculate_polygon_radius_km for a nonrectangular
polygon.
"""
polygon = Location.objects.get(pk=7)
actual = shapes.calculate_polygon_radius_km(polygon.geom)
point = shapes.reverse_coordinate_order(polygon.geom.centroid)
expected = vincenty(point, (8, 0)).kilometers
self.assertEqual(actual, expected)
评论列表
文章目录