#NEWLINE# def test_basic_formset( self ) : #NEWLINE# #INDENT# formset = self . make_choiceformset ( ) #NEWLINE# self . assertHTMLEqual ( str ( formset ) , '<input type="hidden" name="choices-TOTAL_FORMS" value="1" /><input type="hidden" name="choices-INITIAL_FORMS" value="0" /><input type="hidden" name="choices-MAX_NUM_FORMS" value="1000" />\n<tr><th>Choice:</th><td><input type="text" name="choices-0-choice" /></td></tr>\n<tr><th>Votes:</th><td><input type="number" name="choices-0-votes" /></td></tr>' ) #NEWLINE# formset = self . make_choiceformset ( [ ( 'Calexico' , '100' ) ] ) #NEWLINE# self . assertTrue ( formset . is_valid ( ) ) #NEWLINE# self . assertEqual ( [ form . cleaned_data for form in formset . forms ] , [ { #NEWLINE# #INDENT# 'votes' : 100 , #NEWLINE# 'choice' : 'Calexico' , #NEWLINE# #UNINDENT# } ] ) #NEWLINE# formset = self . make_choiceformset ( ) #NEWLINE# self . assertFalse ( formset . is_valid ( ) ) #NEWLINE# self . assertFalse ( formset . has_changed ( ) )