summaryrefslogtreecommitdiff
path: root/tests/regressiontests/inline_formsets
diff options
context:
space:
mode:
authorJoseph Kocherhans <joseph@jkocherhans.com>2010-01-12 02:29:45 +0000
committerJoseph Kocherhans <joseph@jkocherhans.com>2010-01-12 02:29:45 +0000
commit2f9853b2dc90f30317e0374396f08e3d142844d2 (patch)
tree6f5ade3551fbc6ac7caa11eae3b2087e94a0e975 /tests/regressiontests/inline_formsets
parent26279c572101ac1b277fc3947897cb8e840ea42e (diff)
Fixed #12512. Changed ModelForm to stop performing model validation on fields that are not part of the form. Thanks, Honza Kral and Ivan Sagalaev.
This reverts some admin and test changes from [12098] and also fixes #12507, #12520, #12552 and #12553. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12206 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/regressiontests/inline_formsets')
-rw-r--r--tests/regressiontests/inline_formsets/tests.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/regressiontests/inline_formsets/tests.py b/tests/regressiontests/inline_formsets/tests.py
index be313f3bf6..aef6b3f10a 100644
--- a/tests/regressiontests/inline_formsets/tests.py
+++ b/tests/regressiontests/inline_formsets/tests.py
@@ -81,7 +81,7 @@ class DeletionTests(TestCase):
regression for #10750
"""
# exclude some required field from the forms
- ChildFormSet = inlineformset_factory(School, Child)
+ ChildFormSet = inlineformset_factory(School, Child, exclude=['father', 'mother'])
school = School.objects.create(name=u'test')
mother = Parent.objects.create(name=u'mother')
father = Parent.objects.create(name=u'father')
@@ -89,13 +89,13 @@ class DeletionTests(TestCase):
'child_set-TOTAL_FORMS': u'1',
'child_set-INITIAL_FORMS': u'0',
'child_set-0-name': u'child',
- 'child_set-0-mother': unicode(mother.pk),
- 'child_set-0-father': unicode(father.pk),
}
formset = ChildFormSet(data, instance=school)
self.assertEqual(formset.is_valid(), True)
objects = formset.save(commit=False)
- self.assertEqual(school.child_set.count(), 0)
- objects[0].save()
+ for obj in objects:
+ obj.mother = mother
+ obj.father = father
+ obj.save()
self.assertEqual(school.child_set.count(), 1)