mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Refs #32508 -- Raised TypeError instead of using "assert" on unsupported operations for sliced querysets.
This commit is contained in:
@@ -275,6 +275,10 @@ class OnDeleteTests(TestCase):
|
||||
|
||||
|
||||
class DeletionTests(TestCase):
|
||||
def test_sliced_queryset(self):
|
||||
msg = "Cannot use 'limit' or 'offset' with delete()."
|
||||
with self.assertRaisesMessage(TypeError, msg):
|
||||
M.objects.all()[0:5].delete()
|
||||
|
||||
def test_m2m(self):
|
||||
m = M.objects.create()
|
||||
|
||||
Reference in New Issue
Block a user