diff options
| author | Tim Graham <timograham@gmail.com> | 2020-07-30 00:38:02 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-30 06:38:02 +0200 |
| commit | 184a6eebb0ef56d5f1b1315a8e666830e37f3f81 (patch) | |
| tree | 6ee65b2b0f36a66120947a83890a624b28a52257 /tests | |
| parent | eb215da363e6cf0e8f3405db3c4392398c8777cb (diff) | |
Refs #31829 -- Added DatabaseFeatures.json_key_contains_list_matching_requires_list.
CockroachDB's behavior matches PostgreSQL.
Diffstat (limited to 'tests')
| -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 11e82c5998..a7648711ac 100644 --- a/tests/model_fields/test_jsonfield.py +++ b/tests/model_fields/test_jsonfield.py @@ -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): |
