summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEgidijus Macijauskas <e.macijauskas@outlook.com>2021-02-11 06:11:49 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-02-11 09:09:22 +0100
commit98ce39b5a35c9d47b6c34764152fb3b1d2569c3e (patch)
tree85752879e79dd68b607a53155e828dd2e9366a00
parentdd14e639ad8d50c69f5f133278db13c2812d6e54 (diff)
downloaddjango-98ce39b5a35c9d47b6c34764152fb3b1d2569c3e.tar.gz
[3.2.x] Refs #19102 -- Removed flaky test Ticket19102Tests.test_ticket_19102_distinct_on.
The subquery pushdown only happens because another table is involved in filter. It's not the distinct usage that causes the pushdown. The distinct('description').order_by('pk') expression is not valid because SELECT DISTINCT ON must match initial ORDER BY expressions which is not the case here. Backport of 4e8ecf0cb6ea36c45edb9cb86f0d63224e08097e from master
-rw-r--r--tests/delete_regress/tests.py14
1 files changed, 0 insertions, 14 deletions
diff --git a/tests/delete_regress/tests.py b/tests/delete_regress/tests.py
index a1bead144e..e4fa59e89f 100644
--- a/tests/delete_regress/tests.py
+++ b/tests/delete_regress/tests.py
@@ -292,20 +292,6 @@ class Ticket19102Tests(TestCase):
self.assertTrue(Login.objects.filter(pk=self.l2.pk).exists())
@skipUnlessDBFeature("update_can_self_select")
- @skipUnlessDBFeature('can_distinct_on_fields')
- def test_ticket_19102_distinct_on(self):
- # Both Login objs should have same description so that only the one
- # having smaller PK will be deleted.
- Login.objects.update(description='description')
- with self.assertNumQueries(1):
- Login.objects.distinct('description').order_by('pk').filter(
- orgunit__name__isnull=False
- ).delete()
- # Assumed that l1 which is created first has smaller PK.
- self.assertFalse(Login.objects.filter(pk=self.l1.pk).exists())
- self.assertTrue(Login.objects.filter(pk=self.l2.pk).exists())
-
- @skipUnlessDBFeature("update_can_self_select")
def test_ticket_19102_select_related(self):
with self.assertNumQueries(1):
Login.objects.filter(