mirror of
https://github.com/django/django.git
synced 2025-07-24 13:44:32 +00:00
Fixed #11560 -- Allowed proxy model multiple-inheritance from the same concrete base model.
This commit is contained in:
parent
2e0cd26ffb
commit
49f95cc0a0
5 changed files with 29 additions and 8 deletions
|
@ -13,9 +13,9 @@ from django.urls import reverse
|
|||
from .admin import admin as force_admin_model_registration # NOQA
|
||||
from .models import (
|
||||
Abstract, BaseUser, Bug, Country, Improvement, Issue, LowerStatusPerson,
|
||||
MyPerson, MyPersonProxy, OtherPerson, Person, ProxyBug, ProxyImprovement,
|
||||
ProxyProxyBug, ProxyTrackerUser, State, StateProxy, StatusPerson,
|
||||
TrackerUser, User, UserProxy, UserProxyProxy,
|
||||
MultiUserProxy, MyPerson, MyPersonProxy, OtherPerson, Person, ProxyBug,
|
||||
ProxyImprovement, ProxyProxyBug, ProxyTrackerUser, State, StateProxy,
|
||||
StatusPerson, TrackerUser, User, UserProxy, UserProxyProxy,
|
||||
)
|
||||
|
||||
|
||||
|
@ -246,7 +246,7 @@ class ProxyModelTests(TestCase):
|
|||
ctype = ContentType.objects.get_for_model
|
||||
self.assertIs(ctype(Person), ctype(OtherPerson))
|
||||
|
||||
def test_user_userproxy_userproxyproxy(self):
|
||||
def test_user_proxy_models(self):
|
||||
User.objects.create(name='Bruce')
|
||||
|
||||
resp = [u.name for u in User.objects.all()]
|
||||
|
@ -258,6 +258,8 @@ class ProxyModelTests(TestCase):
|
|||
resp = [u.name for u in UserProxyProxy.objects.all()]
|
||||
self.assertEqual(resp, ['Bruce'])
|
||||
|
||||
self.assertEqual([u.name for u in MultiUserProxy.objects.all()], ['Bruce'])
|
||||
|
||||
def test_proxy_for_model(self):
|
||||
self.assertEqual(UserProxy, UserProxyProxy._meta.proxy_for_model)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue