diff options
| author | Tim Graham <timograham@gmail.com> | 2020-07-30 00:38:02 -0400 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-07-30 06:40:32 +0200 |
| commit | 32cb1fe1c66645671681407d47e8370b4afbfc3f (patch) | |
| tree | 092c1550f2338408f7b6bb84fbf38f4e6e3d0862 /tests/model_fields | |
| parent | df8696c0b7ab9cc683816106ea4f9432490fdea1 (diff) | |
[3.1.x] Refs #31829 -- Added DatabaseFeatures.json_key_contains_list_matching_requires_list.
CockroachDB's behavior matches PostgreSQL.
Backport of 184a6eebb0ef56d5f1b1315a8e666830e37f3f81 from master
Diffstat (limited to 'tests/model_fields')
| -rw-r--r-- | tests/model_fields/test_jsonfield.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/model_fields/test_jsonfield.py b/tests/model_fields/test_jsonfield.py index fa6e9e2a34..26643adcdd 100644 --- a/tests/model_fields/test_jsonfield.py +++ b/tests/model_fields/test_jsonfield.py @@ -699,8 +699,9 @@ class TestQuerying(TestCase): )), ), ] - # PostgreSQL requires a layer of nesting. - if connection.vendor != 'postgresql': + # For databases where {'f': 'g'} (without surrounding []) matches + # [{'f': 'g'}]. + if not connection.features.json_key_contains_list_matching_requires_list: tests.append(('value__d__contains', {'f': 'g'})) for lookup, value in tests: with self.subTest(lookup=lookup, value=value): |
