1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[1.1.X] Fixed #12561. InlineAdmin now respects can_delete=False. Backport of [12533] from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12534 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Joseph Kocherhans
2010-02-23 17:26:20 +00:00
parent c7117b103a
commit 6510822679
9 changed files with 94 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ Testing of admin inline formsets.
"""
from django.db import models
from django.contrib import admin
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
@@ -29,6 +30,24 @@ class Child(models.Model):
def __unicode__(self):
return u'I am %s, a child of %s' % (self.name, self.parent)
class Holder(models.Model):
dummy = models.IntegerField()
class Inner(models.Model):
dummy = models.IntegerField()
holder = models.ForeignKey(Holder)
class InnerInline(admin.StackedInline):
model = Inner
can_delete = False
# Test bug #12561
admin.site.register(Holder, inlines=[InnerInline])
__test__ = {'API_TESTS': """
# Regression test for #9362
@@ -48,4 +67,4 @@ inline form.
<Child: I am Joe, a child of John>
"""
}
}