From 471596fc1afcb9c6258d317c619eaf5fd394e797 Mon Sep 17 00:00:00 2001 From: Joseph Kocherhans Date: Tue, 5 Jan 2010 03:56:19 +0000 Subject: Merged soc2009/model-validation to trunk. Thanks, Honza! git-svn-id: http://code.djangoproject.com/svn/django/trunk@12098 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- tests/regressiontests/inline_formsets/tests.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'tests/regressiontests/inline_formsets') diff --git a/tests/regressiontests/inline_formsets/tests.py b/tests/regressiontests/inline_formsets/tests.py index aef6b3f10a..be313f3bf6 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, exclude=['father', 'mother']) + ChildFormSet = inlineformset_factory(School, Child) 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) - for obj in objects: - obj.mother = mother - obj.father = father - obj.save() + self.assertEqual(school.child_set.count(), 0) + objects[0].save() self.assertEqual(school.child_set.count(), 1) -- cgit v1.3