summaryrefslogtreecommitdiff
path: root/tests/regressiontests/modeladmin/models.py
diff options
context:
space:
mode:
authorBrian Rosner <brosner@gmail.com>2008-07-16 02:01:18 +0000
committerBrian Rosner <brosner@gmail.com>2008-07-16 02:01:18 +0000
commit83afd39b1aa0e4235a8490ebc7219f97c35a0106 (patch)
tree1624c5c53ee258336e35ee2606dd43c8b8349956 /tests/regressiontests/modeladmin/models.py
parent5317864e5fda896e777cfd001ec40a3c924b853a (diff)
newforms-admin: Fixed #7772 -- Moved the validation check for when both fields and fieldsets are specified on a ModelAdmin to django/contrib/admin/validation.py. Thanks Julien Phalip for catching this.
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7932 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/modeladmin/models.py')
-rw-r--r--tests/regressiontests/modeladmin/models.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/regressiontests/modeladmin/models.py b/tests/regressiontests/modeladmin/models.py
index 39f8599a78..feb9982786 100644
--- a/tests/regressiontests/modeladmin/models.py
+++ b/tests/regressiontests/modeladmin/models.py
@@ -338,6 +338,14 @@ ImproperlyConfigured: `ValidationTestModelAdmin.fieldsets[0][1]['fields']` refer
... fieldsets = (("General", {"fields": ("name",)}),)
>>> validate(ValidationTestModelAdmin, ValidationTestModel)
+>>> class ValidationTestModelAdmin(ModelAdmin):
+... fieldsets = (("General", {"fields": ("name",)}),)
+... fields = ["name",]
+>>> validate(ValidationTestModelAdmin, ValidationTestModel)
+Traceback (most recent call last):
+...
+ImproperlyConfigured: Both fieldsets and fields are specified in ValidationTestModelAdmin.
+
# form
>>> class FakeForm(object):