mirror of
https://github.com/django/django.git
synced 2025-08-31 07:47:37 +00:00
Thanks to James Murty for his work on an alternate patch.
This commit is contained in:
parent
8bdfabed65
commit
211486f3ab
3 changed files with 15 additions and 2 deletions
|
@ -9,6 +9,7 @@ from django.utils._os import upath
|
|||
|
||||
from .models import (
|
||||
ConcreteModel, ConcreteModelSubclass, ConcreteModelSubclassProxy,
|
||||
ProxyModel,
|
||||
)
|
||||
|
||||
|
||||
|
@ -43,3 +44,10 @@ class MultiTableInheritanceProxyTest(TestCase):
|
|||
self.assertEqual(0, ConcreteModelSubclassProxy.objects.count())
|
||||
self.assertEqual(0, ConcreteModelSubclass.objects.count())
|
||||
self.assertEqual(0, ConcreteModel.objects.count())
|
||||
|
||||
def test_deletion_through_intermediate_proxy(self):
|
||||
child = ConcreteModelSubclass.objects.create()
|
||||
proxy = ProxyModel.objects.get(pk=child.pk)
|
||||
proxy.delete()
|
||||
self.assertFalse(ConcreteModel.objects.exists())
|
||||
self.assertFalse(ConcreteModelSubclass.objects.exists())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue