diff options
| author | Brian Rosner <brosner@gmail.com> | 2008-08-01 18:55:43 +0000 |
|---|---|---|
| committer | Brian Rosner <brosner@gmail.com> | 2008-08-01 18:55:43 +0000 |
| commit | be17a801f6053fe8ef6250cc1a25f80db6956698 (patch) | |
| tree | 2cc2671d42936e61e50d194a3bcf51afb06a9b98 /tests/regressiontests/modeladmin/models.py | |
| parent | 64f5ab67a57f7373cee2cc675ae03d74e878b645 (diff) | |
Fixed #7885 -- Prevent duplicates in fields and fieldsets declarations. Thanks julien and wamberg for the patches.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8173 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/modeladmin/models.py')
| -rw-r--r-- | tests/regressiontests/modeladmin/models.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/regressiontests/modeladmin/models.py b/tests/regressiontests/modeladmin/models.py index 6a7da7d362..0fdd9afdf1 100644 --- a/tests/regressiontests/modeladmin/models.py +++ b/tests/regressiontests/modeladmin/models.py @@ -346,6 +346,20 @@ Traceback (most recent call last): ... ImproperlyConfigured: Both fieldsets and fields are specified in ValidationTestModelAdmin. +>>> class ValidationTestModelAdmin(ModelAdmin): +... fieldsets = [(None, {'fields': ['name', 'name']})] +>>> validate(ValidationTestModelAdmin, ValidationTestModel) +Traceback (most recent call last): +... +ImproperlyConfigured: There are duplicate field(s) in ValidationTestModelAdmin.fieldsets + +>>> class ValidationTestModelAdmin(ModelAdmin): +... fields = ["name", "name"] +>>> validate(ValidationTestModelAdmin, ValidationTestModel) +Traceback (most recent call last): +... +ImproperlyConfigured: There are duplicate field(s) in ValidationTestModelAdmin.fields + # form >>> class FakeForm(object): |
