From ede4f6d48c1fe060c239b2477c00df6bbfd4fd7c Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Sun, 2 Apr 2017 00:02:09 +0500 Subject: Fixed #12410 -- Added LineLocatePoint GIS function. --- tests/gis_tests/geoapp/test_functions.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/gis_tests/geoapp/test_functions.py b/tests/gis_tests/geoapp/test_functions.py index 818ec56e93..ff6d1db9a8 100644 --- a/tests/gis_tests/geoapp/test_functions.py +++ b/tests/gis_tests/geoapp/test_functions.py @@ -286,6 +286,11 @@ class GISFunctionsTests(TestCase): with self.assertRaisesMessage(ValueError, 'AreaField only accepts Area measurement objects.'): qs.get(area__lt=500000) + @skipUnlessDBFeature("has_LineLocatePoint_function") + def test_line_locate_point(self): + pos_expr = functions.LineLocatePoint(LineString((0, 0), (0, 3), srid=4326), Point(0, 1, srid=4326)) + self.assertAlmostEqual(State.objects.annotate(pos=pos_expr).first().pos, 0.3333333) + @skipUnlessDBFeature("has_MakeValid_function") def test_make_valid(self): invalid_geom = fromstr('POLYGON((0 0, 0 1, 1 1, 1 0, 1 1, 1 0, 0 0))') -- cgit v1.3