summaryrefslogtreecommitdiff
path: root/tests/distinct_on_fields
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2020-11-02 10:47:42 -0500
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-11-03 07:32:03 +0100
commit92434bb0f5fa30c7ce3bf9c8ae6600c4da781eac (patch)
tree83d4aa642cad463ce753a8f370190b8485f8e3d8 /tests/distinct_on_fields
parentf814fb6040ee55a6a1b2f1512a0aae1ed321a11b (diff)
downloaddjango-92434bb0f5fa30c7ce3bf9c8ae6600c4da781eac.tar.gz
Fixed DistinctOnTests.test_basic_distinct_on on CockroachDB.
Diffstat (limited to 'tests/distinct_on_fields')
-rw-r--r--tests/distinct_on_fields/tests.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/distinct_on_fields/tests.py b/tests/distinct_on_fields/tests.py
index 009b0191fb..e19c3c1b65 100644
--- a/tests/distinct_on_fields/tests.py
+++ b/tests/distinct_on_fields/tests.py
@@ -1,3 +1,4 @@
+from django.db import connection
from django.db.models import CharField, Max
from django.db.models.functions import Lower
from django.test import TestCase, skipUnlessDBFeature
@@ -70,7 +71,9 @@ class DistinctOnTests(TestCase):
),
(
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'),