diff options
| author | Brian Rosner <brosner@gmail.com> | 2008-07-17 16:11:49 +0000 |
|---|---|---|
| committer | Brian Rosner <brosner@gmail.com> | 2008-07-17 16:11:49 +0000 |
| commit | 81b185319c86d4770af88a6781cbbfcd1def7ab5 (patch) | |
| tree | bf67716783fad7d081f22779c3b0032c0bccf9fe /tests/regressiontests | |
| parent | dce7cfee16094cb1dd060fb4d90ab73f62069317 (diff) | |
newforms-admin: Fixed #7794 -- Allow BaseModelFormSet classes to work as an inline formset. This just loosens the validator checks. Thanks paltman for the report.
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7942 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
| -rw-r--r-- | tests/regressiontests/modeladmin/models.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/regressiontests/modeladmin/models.py b/tests/regressiontests/modeladmin/models.py index feb9982786..5cd27dd3c1 100644 --- a/tests/regressiontests/modeladmin/models.py +++ b/tests/regressiontests/modeladmin/models.py @@ -797,6 +797,8 @@ ImproperlyConfigured: `ValidationTestInline.max_num` should be a integer. # formset +>>> from django.newforms.models import BaseModelFormSet + >>> class FakeFormSet(object): ... pass >>> class ValidationTestInline(TabularInline): @@ -807,7 +809,16 @@ ImproperlyConfigured: `ValidationTestInline.max_num` should be a integer. >>> validate(ValidationTestModelAdmin, ValidationTestModel) Traceback (most recent call last): ... -ImproperlyConfigured: `ValidationTestInline.formset` does not inherit from BaseInlineFormset. +ImproperlyConfigured: `ValidationTestInline.formset` does not inherit from BaseModelFormSet. + +>>> class RealModelFormSet(BaseModelFormSet): +... pass +>>> class ValidationTestInline(TabularInline): +... model = ValidationTestInlineModel +... formset = RealModelFormSet +>>> class ValidationTestModelAdmin(ModelAdmin): +... inlines = [ValidationTestInline] +>>> validate(ValidationTestModelAdmin, ValidationTestModel) """ } |
