Refs #28214 -- Added test for escaping JSONField key lookups.
Thanks mrsanders for the report.
Fixed in 7deeabc7c7
.
This commit is contained in:
parent
de1924e0e7
commit
7fa1a93c6c
|
@ -411,6 +411,10 @@ class TestQuerying(PostgreSQLTestCase):
|
||||||
**{lookup: value},
|
**{lookup: value},
|
||||||
).exists())
|
).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')
|
@isolate_apps('postgres_tests')
|
||||||
class TestChecks(PostgreSQLSimpleTestCase):
|
class TestChecks(PostgreSQLSimpleTestCase):
|
||||||
|
|
Loading…
Reference in New Issue