1
0
mirror of https://github.com/django/django.git synced 2025-03-24 16:20:46 +00:00

Refs #28214 -- Added test for escaping JSONField key lookups.

Thanks mrsanders for the report.

Fixed in 7deeabc7c7526786df6894429ce89a9c4b614086.
This commit is contained in:
Mariusz Felisiak 2020-02-05 14:31:30 +01:00 committed by GitHub
parent de1924e0e7
commit 7fa1a93c6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -411,6 +411,10 @@ class TestQuerying(PostgreSQLTestCase):
**{lookup: value},
).exists())
def test_key_escape(self):
obj = JSONModel.objects.create(field={'%total': 10})
self.assertEqual(JSONModel.objects.filter(**{'field__%total': 10}).get(), obj)
@isolate_apps('postgres_tests')
class TestChecks(PostgreSQLSimpleTestCase):