diff options
author | Stephen Burrows <stephen.r.burrows@gmail.com> | 2014-05-15 20:12:32 -0700 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2014-05-16 06:38:24 -0400 |
commit | d64f192df188903ea5a1ab8dfd6679e5d52aaf9b (patch) | |
tree | 4e30d099ba136c56c638483123c7477ea64995d4 /tests/model_formsets | |
parent | 4a981307359d5886d7e982aad8cfdac84d21152c (diff) | |
download | django-d64f192df188903ea5a1ab8dfd6679e5d52aaf9b.tar.gz |
Fixed #22628 -- Took initial forms into account when combining FormSet.min_num and FormSet.extra.
Forwardport of 79f15ab1ef from stable/1.7.x
Diffstat (limited to 'tests/model_formsets')
-rw-r--r-- | tests/model_formsets/tests.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/model_formsets/tests.py b/tests/model_formsets/tests.py index ed74dff2ed..2913f6c0ab 100644 --- a/tests/model_formsets/tests.py +++ b/tests/model_formsets/tests.py @@ -395,13 +395,12 @@ class ModelFormsetTest(TestCase): def test_min_num_with_existing(self): # Test the behavior of min_num with existing objects. - # See #22628 - this will change when that's fixed. Author.objects.create(name='Charles Baudelaire') qs = Author.objects.all() AuthorFormSet = modelformset_factory(Author, fields="__all__", extra=0, min_num=1) formset = AuthorFormSet(queryset=qs) - self.assertEqual(len(formset.forms), 2) + self.assertEqual(len(formset.forms), 1) def test_custom_save_method(self): class PoetForm(forms.ModelForm): |