1
0
mirror of https://github.com/django/django.git synced 2025-10-27 15:46:10 +00:00

Fixed #32575 -- Added support for SpatiaLite 5.

This commit is contained in:
Claude Paroz
2021-04-03 16:23:19 +02:00
committed by Mariusz Felisiak
parent b9d156761f
commit 30e123ed35
10 changed files with 47 additions and 25 deletions

View File

@@ -183,7 +183,11 @@ class GISFunctionsTests(FuncTestMixin, TestCase):
def test_azimuth(self):
# Returns the azimuth in radians.
azimuth_expr = functions.Azimuth(Point(0, 0, srid=4326), Point(1, 1, srid=4326))
self.assertAlmostEqual(City.objects.annotate(azimuth=azimuth_expr).first().azimuth, math.pi / 4)
self.assertAlmostEqual(
City.objects.annotate(azimuth=azimuth_expr).first().azimuth,
math.pi / 4,
places=2,
)
# Returns None if the two points are coincident.
azimuth_expr = functions.Azimuth(Point(0, 0, srid=4326), Point(0, 0, srid=4326))
self.assertIsNone(City.objects.annotate(azimuth=azimuth_expr).first().azimuth)