1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #13309 -- Ensure that delete() deletes everything it should delete(). Thanks to craig.kimerer@gmail.com for the report.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@12941 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2010-04-09 13:24:13 +00:00
parent 7b47609629
commit 040c18b17e
2 changed files with 10 additions and 1 deletions

View File

@@ -106,3 +106,11 @@ class DeleteCascadeTests(TestCase):
self.assertEquals(PlayedWith.objects.count(), 0)
# first two asserts just sanity checks, this is the kicker:
self.assertEquals(PlayedWithNote.objects.count(), 0)
class LargeDeleteTests(TestCase):
def test_large_deletes(self):
"Regression for #13309 -- if the number of objects > chunk size, deletion still occurs"
for x in range(300):
track = Book.objects.create(pagecount=x+100)
Book.objects.all().delete()
self.assertEquals(Book.objects.count(), 0)