#NEWLINE# def test_displaying_more_than_one_blank_form( self ) : #NEWLINE# #INDENT# ChoiceFormSet = formset_factory ( Choice , extra = 3 ) #NEWLINE# formset = ChoiceFormSet ( auto_id = False , prefix = 'choices' ) #NEWLINE# form_output = [ ] #NEWLINE# for form in formset . forms : #NEWLINE# #INDENT# form_output . append ( form . as_ul ( ) ) #NEWLINE# #UNINDENT# self . assertHTMLEqual ( '\n' . join ( form_output ) , '<li>Choice: <input type="text" name="choices-0-choice" /></li>\n<li>Votes: <input type="text" name="choices-0-votes" /></li>\n<li>Choice: <input type="text" name="choices-1-choice" /></li>\n<li>Votes: <input type="text" name="choices-1-votes" /></li>\n<li>Choice: <input type="text" name="choices-2-choice" /></li>\n<li>Votes: <input type="text" name="choices-2-votes" /></li>' ) #NEWLINE# data = { #NEWLINE# #INDENT# 'choices-TOTAL_FORMS' : '3' , #NEWLINE# 'choices-INITIAL_FORMS' : '0' , #NEWLINE# 'choices-MAX_NUM_FORMS' : '0' , #NEWLINE# 'choices-0-choice' : '' , #NEWLINE# 'choices-0-votes' : '' , #NEWLINE# 'choices-1-choice' : '' , #NEWLINE# 'choices-1-votes' : '' , #NEWLINE# 'choices-2-choice' : '' , #NEWLINE# 'choices-2-votes' : '' , #NEWLINE# #UNINDENT# } #NEWLINE# formset = ChoiceFormSet ( form_output , auto_id = False , prefix = 'choices' ) #NEWLINE# self . assertTrue ( formset . is_valid ( ) ) #NEWLINE# self . assertEqual ( [ form . cleaned_data for form in formset . forms ] , [ { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ] )