diff --git a/tests/queries/test_qs_combinators.py b/tests/queries/test_qs_combinators.py
index 84fb0fb81c..9b5d538bae 100644
a
|
b
|
class QuerySetSetOperationTests(TestCase):
|
30 | 30 | qs3 = Number.objects.filter(num__gte=4, num__lte=6) |
31 | 31 | self.assertNumbersEqual(qs1.intersection(qs2, qs3), [5], ordered=False) |
32 | 32 | |
| 33 | @skipUnlessDBFeature('supports_select_intersection') |
| 34 | def test_intersection_with_values(self): |
| 35 | ReservedName.objects.create(name='a', order=2) |
| 36 | qs1 = ReservedName.objects.all() |
| 37 | reserved_name = qs1.intersection(qs1).values('name', 'order', 'id').get() |
| 38 | self.assertEqual(reserved_name['name'], 'a') |
| 39 | self.assertEqual(reserved_name['order'], 2) |
| 40 | |
33 | 41 | @skipUnlessDBFeature('supports_select_difference') |
34 | 42 | def test_simple_difference(self): |
35 | 43 | qs1 = Number.objects.filter(num__lte=5) |
… |
… |
class QuerySetSetOperationTests(TestCase):
|
66 | 74 | self.assertEqual(len(qs2.difference(qs2)), 0) |
67 | 75 | self.assertEqual(len(qs3.difference(qs3)), 0) |
68 | 76 | |
| 77 | @skipUnlessDBFeature('supports_select_difference') |
| 78 | def test_difference_with_values(self): |
| 79 | ReservedName.objects.create(name='a', order=2) |
| 80 | qs1 = ReservedName.objects.all() |
| 81 | qs2 = ReservedName.objects.none() |
| 82 | reserved_name = qs1.difference(qs2).values('name', 'order', 'id').get() |
| 83 | self.assertEqual(reserved_name['name'], 'a') |
| 84 | self.assertEqual(reserved_name['order'], 2) |
| 85 | |
69 | 86 | def test_union_with_empty_qs(self): |
70 | 87 | qs1 = Number.objects.all() |
71 | 88 | qs2 = Number.objects.none() |
… |
… |
class QuerySetSetOperationTests(TestCase):
|
89 | 106 | qs2 = Number.objects.filter(num__gte=2, num__lte=3) |
90 | 107 | self.assertNumbersEqual(qs1.union(qs2).order_by('-num'), [3, 2, 1, 0]) |
91 | 108 | |
| 109 | def test_union_with_values(self): |
| 110 | ReservedName.objects.create(name='a', order=2) |
| 111 | qs1 = ReservedName.objects.all() |
| 112 | reserved_name = qs1.union(qs1).values('name', 'order', 'id').get() |
| 113 | self.assertEqual(reserved_name['name'], 'a') |
| 114 | self.assertEqual(reserved_name['order'], 2) |
| 115 | |
92 | 116 | def test_count_union(self): |
93 | 117 | qs1 = Number.objects.filter(num__lte=1).values('num') |
94 | 118 | qs2 = Number.objects.filter(num__gte=2, num__lte=3).values('num') |