diff options
| author | Sergey Fedoseev <fedoseev.sergey@gmail.com> | 2017-04-02 00:02:09 +0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-04-01 15:02:09 -0400 |
| commit | ede4f6d48c1fe060c239b2477c00df6bbfd4fd7c (patch) | |
| tree | 953aa4ddd3692a0bf5141bfeb7cb4b1a4fb454ce /tests | |
| parent | 7b53041420009ad430035116c25f36804e714cd5 (diff) | |
Fixed #12410 -- Added LineLocatePoint GIS function.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/gis_tests/geoapp/test_functions.py | 5 |
1 files changed, 5 insertions, 0 deletions
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))') |
