1
0
mirror of https://github.com/django/django.git synced 2025-03-12 10:22:37 +00:00

Fixed DistinctOnTests.test_basic_distinct_on on CockroachDB.

This commit is contained in:
Tim Graham 2020-11-02 10:47:42 -05:00 committed by Mariusz Felisiak
parent f814fb6040
commit 92434bb0f5

View File

@ -1,3 +1,4 @@
from django.db import connection
from django.db.models import CharField, Max from django.db.models import CharField, Max
from django.db.models.functions import Lower from django.db.models.functions import Lower
from django.test import TestCase, skipUnlessDBFeature from django.test import TestCase, skipUnlessDBFeature
@ -70,7 +71,9 @@ class DistinctOnTests(TestCase):
), ),
( (
Tag.objects.order_by('parent__pk', 'pk').distinct('parent'), Tag.objects.order_by('parent__pk', 'pk').distinct('parent'),
['<Tag: t2>', '<Tag: t4>', '<Tag: t1>'], ['<Tag: t2>', '<Tag: t4>', '<Tag: t1>']
if connection.features.nulls_order_largest
else ['<Tag: t1>', '<Tag: t2>', '<Tag: t4>'],
), ),
( (
StaffTag.objects.select_related('staff').distinct('staff__name').order_by('staff__name'), StaffTag.objects.select_related('staff').distinct('staff__name').order_by('staff__name'),