diff --git a/tests/postgres_tests/test_json.py b/tests/postgres_tests/test_json.py index 0ffa05f981..2ff765e918 100644 --- a/tests/postgres_tests/test_json.py +++ b/tests/postgres_tests/test_json.py @@ -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):