1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Fixed #14119 -- fields_for_model no longer returns all fields when fields parameter is the empty tuple. Thanks alexdutton!

git-svn-id: http://code.djangoproject.com/svn/django/trunk@14199 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Honza Král
2010-10-13 04:46:33 +00:00
parent 52716ddd1b
commit 00a685178a
3 changed files with 36 additions and 3 deletions

View File

@@ -159,6 +159,14 @@ class InlineFormsetTests(TestCase):
form = Form(instance=None)
formset = FormSet(instance=None)
def test_empty_fields_on_modelformset(self):
"No fields passed to modelformset_factory should result in no fields on returned forms except for the id. See #14119."
UserFormSet = modelformset_factory(User, fields=())
formset = UserFormSet()
for form in formset.forms:
self.assertTrue('id' in form.fields)
self.assertEqual(len(form.fields), 1)
class CustomWidget(forms.CharField):
pass