Fixed #25629 -- Added checks of the number of arguments for GeoDjango DB functions.

This commit is contained in:
Sergey Fedoseev 2015-10-30 19:47:35 +05:00 committed by Claude Paroz
parent 1b598b4b42
commit a449b7ef99
2 changed files with 18 additions and 9 deletions

View file

@ -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)