mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16: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:
@@ -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>
|
||||
|
||||
"""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user