Skip to content

Commit f4bab09

Browse files
authored
Refs #31614 -- Added test for ordering by OrderBy() of combined queryset with not selected columns.
1 parent 587b179 commit f4bab09

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/queries/test_qs_combinators.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ def test_order_raises_on_non_selected_column(self):
268268
list(qs1.union(qs2).order_by('num'))
269269
with self.assertRaisesMessage(DatabaseError, msg):
270270
list(qs1.union(qs2).order_by(F('num')))
271+
with self.assertRaisesMessage(DatabaseError, msg):
272+
list(qs1.union(qs2).order_by(F('num').desc()))
271273
# switched order, now 'exists' again:
272274
list(qs2.union(qs1).order_by('num'))
273275

0 commit comments

Comments
 (0)