#NEWLINE# def test_max_num_with_initial_data( self ) : #NEWLINE# #INDENT# initial = [ { #NEWLINE# #INDENT# 'name' : 'Fernet and Coke' , #NEWLINE# #UNINDENT# } ] #NEWLINE# LimitedFavoriteDrinkFormSet = formset_factory ( FavoriteDrinkForm , extra = 1 ) #NEWLINE# formset = LimitedFavoriteDrinkFormSet ( initial = initial ) #NEWLINE# form_output = [ ] #NEWLINE# for form in formset . forms : #NEWLINE# #INDENT# form_output . append ( str ( form ) ) #NEWLINE# #UNINDENT# self . assertHTMLEqual ( '\n' . join ( form_output ) , '<tr><th><label for="id_form-0-name">Name:</label></th><td><input type="text" name="form-0-name" value="Fernet and Coke" id="id_form-0-name" /></td></tr>\n<tr><th><label for="id_form-1-name">Name:</label></th><td><input type="text" name="form-1-name" id="id_form-1-name" /></td></tr>' )