1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Fixed JSONField's test_deep_distinct for DatabaseFeatures.nulls_order_largest=False.

Failure observed on CockroachDB.
This commit is contained in:
Tim Graham 2023-09-22 00:25:17 -04:00 committed by GitHub
parent 779cd28acb
commit b0788a0918
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -700,7 +700,10 @@ class TestQuerying(TestCase):
query = NullableJSONModel.objects.distinct("value__k__l").values_list(
"value__k__l"
)
self.assertSequenceEqual(query, [("m",), (None,)])
expected = [("m",), (None,)]
if not connection.features.nulls_order_largest:
expected.reverse()
self.assertSequenceEqual(query, expected)
def test_isnull_key(self):
# key__isnull=False works the same as has_key='key'.