From a449b7ef99efdbb5edc8b4aacc89eb6020145dd3 Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Fri, 30 Oct 2015 19:47:35 +0500 Subject: Fixed #25629 -- Added checks of the number of arguments for GeoDjango DB functions. --- tests/gis_tests/geoapp/test_functions.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') diff --git a/tests/gis_tests/geoapp/test_functions.py b/tests/gis_tests/geoapp/test_functions.py index ff99cc4855..d778810480 100644 --- a/tests/gis_tests/geoapp/test_functions.py +++ b/tests/gis_tests/geoapp/test_functions.py @@ -160,6 +160,9 @@ class GISFunctionsTests(TestCase): for state in qs: self.assertTrue(state.poly.centroid.equals_exact(state.centroid, tol)) + with self.assertRaisesMessage(TypeError, "'Centroid' takes exactly 1 argument (2 given)"): + State.objects.annotate(centroid=functions.Centroid('poly', 'poly')) + @skipUnlessDBFeature("has_Difference_function") def test_difference(self): geom = Point(5, 23, srid=4326) -- cgit v1.3