summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2020-07-07 12:15:05 +0200
committerGitHub <noreply@github.com>2020-07-07 12:15:05 +0200
commitae8338daf34fd746771e0678081999b656177bae (patch)
treeb9b3e84191821522e419b8633c60b99fa9511d6c /tests
parentcb0da637a69b79ab371be9ee202335190a3a506e (diff)
Fixed #31767 -- Fixed QuerySet.none() on combined queryset.
Diffstat (limited to 'tests')
-rw-r--r--tests/queries/test_qs_combinators.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/queries/test_qs_combinators.py b/tests/queries/test_qs_combinators.py
index 9c6fd474ca..75e2aa2f39 100644
--- a/tests/queries/test_qs_combinators.py
+++ b/tests/queries/test_qs_combinators.py
@@ -51,6 +51,13 @@ class QuerySetSetOperationTests(TestCase):
self.assertEqual(len(list(qs1.union(qs2, all=True))), 20)
self.assertEqual(len(list(qs1.union(qs2))), 10)
+ def test_union_none(self):
+ qs1 = Number.objects.filter(num__lte=1)
+ qs2 = Number.objects.filter(num__gte=8)
+ qs3 = qs1.union(qs2)
+ self.assertSequenceEqual(qs3.none(), [])
+ self.assertNumbersEqual(qs3, [0, 1, 8, 9], ordered=False)
+
@skipUnlessDBFeature('supports_select_intersection')
def test_intersection_with_empty_qs(self):
qs1 = Number.objects.all()