Deleting the *proxy* instance bubbles through to its non-proxy and *all* referring objects are deleted.
(self)
| 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 | """ |
nothing calls this directly
no test coverage detected