Refs #31829 -- Added DatabaseFeatures.json_key_contains_list_matching_requires_list.

CockroachDB's behavior matches PostgreSQL.
This commit is contained in:
Tim Graham 2020-07-30 00:38:02 -04:00 committed by GitHub
parent eb215da363
commit 184a6eebb0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View file

@ -714,8 +714,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):