diff options
author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-02-21 12:47:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-21 12:47:52 +0100 |
commit | 96bc4254ee84596e0d1fef1f2356d8736da3857a (patch) | |
tree | a2faad121c891c5791e8b6195f6b60d227980cb6 /tests/queries | |
parent | a91e59e4a0fa9cbc6c662feaad6ac17b0f07ce9a (diff) | |
download | django-96bc4254ee84596e0d1fef1f2356d8736da3857a.tar.gz |
Refs #31445 -- Added test for nesting QuerySet.union().
This was fixed in MySQL 8.0.31.
Diffstat (limited to 'tests/queries')
-rw-r--r-- | tests/queries/test_qs_combinators.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/queries/test_qs_combinators.py b/tests/queries/test_qs_combinators.py index 96a5b24cc1..bf127ce703 100644 --- a/tests/queries/test_qs_combinators.py +++ b/tests/queries/test_qs_combinators.py @@ -114,6 +114,15 @@ class QuerySetSetOperationTests(TestCase): [1, 2, 3, 4, 6, 7, 8, 9, 10, None], ) + def test_union_nested(self): + qs1 = Number.objects.all() + qs2 = qs1.union(qs1) + self.assertNumbersEqual( + qs1.union(qs2), + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], + ordered=False, + ) + @skipUnlessDBFeature("supports_select_intersection") def test_intersection_with_empty_qs(self): qs1 = Number.objects.all() |