summaryrefslogtreecommitdiff
path: root/tests/delete
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2015-12-13 23:46:41 -0500
committerSimon Charette <charette.s@gmail.com>2015-12-14 13:12:36 -0500
commit8035cee92293f3319919c8248c7787ba43c05917 (patch)
tree1d210cccd6ea810ecc1854b33785ce7141ca28b0 /tests/delete
parent5233b70070f8979f41ca1da2c1b1d78c8e30944e (diff)
Fixed #25882 -- Prevented fast deletes matching no rows from crashing on MySQL.
Thanks to Trac aliases gerricom for the report, raphaelmerx for the attempts to reproduce and Sergey Fedoseev and Tim for the review. Refs #16891
Diffstat (limited to 'tests/delete')
-rw-r--r--tests/delete/tests.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/delete/tests.py b/tests/delete/tests.py
index 663a22791b..1a8941904c 100644
--- a/tests/delete/tests.py
+++ b/tests/delete/tests.py
@@ -503,3 +503,15 @@ class FastDeleteTests(TestCase):
# that + fast delete of the related objs.
self.assertNumQueries(2, a.delete)
self.assertEqual(User.objects.count(), 0)
+
+ def test_fast_delete_empty_no_update_can_self_select(self):
+ """
+ #25932 - Fast deleting on backends that don't have the
+ `no_update_can_self_select` feature should work even if the specified
+ filter doesn't match any row.
+ """
+ with self.assertNumQueries(1):
+ self.assertEqual(
+ User.objects.filter(avatar__desc='missing').delete(),
+ (0, {'delete.User': 0})
+ )