summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJoseph Kocherhans <joseph@jkocherhans.com>2007-12-13 03:14:31 +0000
committerJoseph Kocherhans <joseph@jkocherhans.com>2007-12-13 03:14:31 +0000
commit4c59ca602063f5de88595dfb18b0f83bc7bba0f7 (patch)
treed532502bf85d517700e7153be27410117b9c04fb /tests
parente415eff0ead50882525129b0d5fd8ca95f1d30a7 (diff)
Changed ModelForms to allow inheritance as long as their model attributes are the same.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6917 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r--tests/modeltests/model_forms/models.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/modeltests/model_forms/models.py b/tests/modeltests/model_forms/models.py
index 5e9584496e..17c3b3551c 100644
--- a/tests/modeltests/model_forms/models.py
+++ b/tests/modeltests/model_forms/models.py
@@ -143,7 +143,7 @@ familiar with the mechanics.
... model = Article
Traceback (most recent call last):
...
-ImproperlyConfigured: BadForm defines more than one model.
+ImproperlyConfigured: BadForm defines a different model than its parent.
>>> class ArticleForm(ModelForm):
... class Meta:
@@ -155,6 +155,12 @@ Traceback (most recent call last):
...
ImproperlyConfigured: BadForm's base classes define more than one model.
+This one is OK since the subclass specifies the same model as the parent.
+
+>>> class SubCategoryForm(CategoryForm):
+... class Meta:
+... model = Category
+
# Old form_for_x tests #######################################################