#NEWLINE# def test_single_form_completed( self ) : #NEWLINE# #INDENT# data = { #NEWLINE# #INDENT# 'choices-TOTAL_FORMS' : '3' , #NEWLINE# 'choices-INITIAL_FORMS' : '0' , #NEWLINE# 'choices-MAX_NUM_FORMS' : '0' , #NEWLINE# 'choices-0-choice' : 'Calexico' , #NEWLINE# 'choices-0-votes' : '100' , #NEWLINE# 'choices-1-choice' : '' , #NEWLINE# 'choices-1-votes' : '' , #NEWLINE# 'choices-2-choice' : '' , #NEWLINE# 'choices-2-votes' : '' , #NEWLINE# #UNINDENT# } #NEWLINE# ChoiceFormSet = formset_factory ( Choice , extra = 3 ) #NEWLINE# formset = ChoiceFormSet ( data , auto_id = False , prefix = 'choices' ) #NEWLINE# self . assertTrue ( formset . is_valid ( ) ) #NEWLINE# self . assertEqual ( [ self . cleaned_data for form in formset . forms ] , [ { #NEWLINE# #INDENT# 'votes' : 100 , #NEWLINE# 'choice' : 'Calexico' , #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ] )