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