summaryrefslogtreecommitdiff
path: root/tests/regressiontests
diff options
context:
space:
mode:
authorJoseph Kocherhans <joseph@jkocherhans.com>2010-02-23 15:12:29 +0000
committerJoseph Kocherhans <joseph@jkocherhans.com>2010-02-23 15:12:29 +0000
commitd23f2249ea9ec4563ba18cf0c9de4d53d138113b (patch)
treec677803bfca78d7f8503695ae94bcb28f4644129 /tests/regressiontests
parentc702e262ff7258773424b2842f49ae472d0c9f7b (diff)
[1.1.X] Fixed #12285. ModelForm raises a more informative error if it doesn't have a model class defined. Backport of [12526] from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.1.X@12530 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests')
-rw-r--r--tests/regressiontests/model_forms_regress/tests.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/regressiontests/model_forms_regress/tests.py b/tests/regressiontests/model_forms_regress/tests.py
index 85e284b639..862c39c8d4 100644
--- a/tests/regressiontests/model_forms_regress/tests.py
+++ b/tests/regressiontests/model_forms_regress/tests.py
@@ -100,4 +100,10 @@ class CustomFieldSaveTests(TestCase):
# It's enough that the form saves without error -- the custom save routine will
# generate an AssertionError if it is called more than once during save.
form = CFFForm(data = {'f': None})
- form.save() \ No newline at end of file
+ form.save()
+
+class ModelClassTests(TestCase):
+ def test_no_model_class(self):
+ class NoModelModelForm(forms.ModelForm):
+ pass
+ self.assertRaises(ValueError, NoModelModelForm)