diff --git a/tests/queries/test_qs_combinators.py b/tests/queries/test_qs_combinators.py
index e1ff860bf0..0bc1d053f3 100644
a
|
b
|
class QuerySetSetOperationTests(TestCase):
|
46 | 46 | def test_intersection_with_empty_qs(self): |
47 | 47 | qs1 = Number.objects.all() |
48 | 48 | qs2 = Number.objects.none() |
| 49 | qs3 = Number.objects.filter(pk__in=[]) |
49 | 50 | self.assertEqual(len(qs1.intersection(qs2)), 0) |
50 | 51 | self.assertEqual(len(qs2.intersection(qs1)), 0) |
51 | 52 | self.assertEqual(len(qs2.intersection(qs2)), 0) |
| 53 | self.assertEqual(len(qs1.intersection(qs3)), 0) |
| 54 | self.assertEqual(len(qs3.intersection(qs1)), 0) |
52 | 55 | |
53 | 56 | @skipUnlessDBFeature('supports_select_difference') |
54 | 57 | def test_difference_with_empty_qs(self): |
55 | 58 | qs1 = Number.objects.all() |
56 | 59 | qs2 = Number.objects.none() |
| 60 | qs3 = Number.objects.filter(pk__in=[]) |
57 | 61 | self.assertEqual(len(qs1.difference(qs2)), 10) |
| 62 | self.assertEqual(len(qs1.difference(qs3)), 10) |
58 | 63 | self.assertEqual(len(qs2.difference(qs1)), 0) |
| 64 | self.assertEqual(len(qs3.difference(qs1)), 0) |
59 | 65 | self.assertEqual(len(qs2.difference(qs2)), 0) |
60 | 66 | |
61 | 67 | def test_union_with_empty_qs(self): |
62 | 68 | qs1 = Number.objects.all() |
63 | 69 | qs2 = Number.objects.none() |
| 70 | qs3 = Number.objects.filter(pk__in=[]) |
64 | 71 | self.assertEqual(len(qs1.union(qs2)), 10) |
65 | 72 | self.assertEqual(len(qs2.union(qs1)), 10) |
| 73 | self.assertEqual(len(qs1.union(qs3)), 10) |
| 74 | self.assertEqual(len(qs3.union(qs1)), 10) |
66 | 75 | self.assertEqual(len(qs2.union(qs1, qs1, qs1)), 10) |
67 | 76 | self.assertEqual(len(qs2.union(qs1, qs1, all=True)), 20) |
68 | 77 | self.assertEqual(len(qs2.union(qs2)), 0) |