MCPcopy
hub / github.com/django/django / test_delete_proxy

Method test_delete_proxy

tests/delete_regress/tests.py:198–213  ·  view source on GitHub ↗

Deleting the *proxy* instance bubbles through to its non-proxy and *all* referring objects are deleted.

(self)

Source from the content-addressed store, hash-verified

196 return test_image
197
198 def test_delete_proxy(self):
199 """
200 Deleting the *proxy* instance bubbles through to its non-proxy and
201 *all* referring objects are deleted.
202 """
203 self.create_image()
204
205 Image.objects.all().delete()
206
207 # An Image deletion == File deletion
208 self.assertEqual(len(Image.objects.all()), 0)
209 self.assertEqual(len(File.objects.all()), 0)
210
211 # The Image deletion cascaded and *all* references to it are deleted.
212 self.assertEqual(len(FooImage.objects.all()), 0)
213 self.assertEqual(len(FooFile.objects.all()), 0)
214
215 def test_delete_proxy_of_proxy(self):
216 """

Callers

nothing calls this directly

Calls 3

create_imageMethod · 0.95
deleteMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected