From b72298de75952a5f8871f973c3e62f6634588443 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Mon, 10 Jul 2017 19:42:58 +0200 Subject: [PATCH] [1.11.x] Added test for intersection() when combining with a queryset raising EmptyResultSet. Backport of 9bca0d0b38d941fe7f3842cb2259d018823ed25e from master --- tests/queries/test_qs_combinators.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/queries/test_qs_combinators.py b/tests/queries/test_qs_combinators.py index ec341952ea..235eb4f15d 100644 --- a/tests/queries/test_qs_combinators.py +++ b/tests/queries/test_qs_combinators.py @@ -49,9 +49,13 @@ class QuerySetSetOperationTests(TestCase): def test_intersection_with_empty_qs(self): qs1 = Number.objects.all() qs2 = Number.objects.none() + qs3 = Number.objects.filter(pk__in=[]) self.assertEqual(len(qs1.intersection(qs2)), 0) + self.assertEqual(len(qs1.intersection(qs3)), 0) self.assertEqual(len(qs2.intersection(qs1)), 0) + self.assertEqual(len(qs3.intersection(qs1)), 0) self.assertEqual(len(qs2.intersection(qs2)), 0) + self.assertEqual(len(qs3.intersection(qs3)), 0) @skipUnlessDBFeature('supports_select_difference') def test_difference_with_empty_qs(self):