1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Migrated admin_inlines doctest. Thanks to Sebastian Hillig.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13880 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Russell Keith-Magee
2010-09-27 15:11:03 +00:00
parent ea07fe7a3f
commit 856a9e953b
2 changed files with 21 additions and 22 deletions

View File

@@ -123,25 +123,3 @@ class InlineWeakness(admin.TabularInline):
extra = 1
admin.site.register(Fashionista, inlines=[InlineWeakness])
__test__ = {'API_TESTS': """
# Regression test for #9362
>>> sally = Teacher.objects.create(name='Sally')
>>> john = Parent.objects.create(name='John')
>>> joe = Child.objects.create(name='Joe', teacher=sally, parent=john)
The problem depends only on InlineAdminForm and its "original" argument, so
we can safely set the other arguments to None/{}. We just need to check that
the content_type argument of Child isn't altered by the internals of the
inline form.
>>> from django.contrib.admin.helpers import InlineAdminForm
>>> iaf = InlineAdminForm(None, None, {}, {}, joe)
>>> iaf.original
<Child: I am Joe, a child of John>
"""
}