1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #31162 -- Prevented error logs when using WKT strings in lookups.

Thanks dbxnr for the initial patch.

Regression in 6f44f714c9.
This commit is contained in:
Mariusz Felisiak
2020-01-16 14:34:54 +01:00
committed by GitHub
parent d08d4f464a
commit 266c853e10
3 changed files with 19 additions and 1 deletions

View File

@@ -430,6 +430,12 @@ class GeoLookupTest(TestCase):
with self.subTest(lookup=lookup):
self.assertNotIn(null, State.objects.filter(**{'poly__%s' % lookup: geom}))
def test_wkt_string_in_lookup(self):
# Valid WKT strings don't emit error logs.
with self.assertRaisesMessage(AssertionError, 'no logs'):
with self.assertLogs('django.contrib.gis', 'ERROR'):
State.objects.filter(poly__intersects='LINESTRING(0 0, 1 1, 5 5)')
@skipUnlessDBFeature("supports_relate_lookup")
def test_relate_lookup(self):
"Testing the 'relate' lookup type."