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:
committed by
Mariusz Felisiak
parent
b9d156761f
commit
30e123ed35
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user