MCPcopy
hub / github.com/django/django / test_large_deletes

Method test_large_deletes

tests/delete_regress/tests.py:159–173  ·  view source on GitHub ↗

If the number of objects > chunk size, deletion still occurs.

(self)

Source from the content-addressed store, hash-verified

157
158class LargeDeleteTests(TestCase):
159 def test_large_deletes(self):
160 """
161 If the number of objects > chunk size, deletion still occurs.
162 """
163 for x in range(300):
164 Book.objects.create(pagecount=x + 100)
165 # attach a signal to make sure we will not fast-delete
166
167 def noop(*args, **kwargs):
168 pass
169
170 models.signals.post_delete.connect(noop, sender=Book)
171 Book.objects.all().delete()
172 models.signals.post_delete.disconnect(noop, sender=Book)
173 self.assertEqual(Book.objects.count(), 0)
174
175
176class ProxyDeleteTest(TestCase):

Callers

nothing calls this directly

Calls 6

createMethod · 0.45
connectMethod · 0.45
deleteMethod · 0.45
allMethod · 0.45
disconnectMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected