#NEWLINE# def test_formsets_with_hidden_fields( self ) : #NEWLINE# #INDENT# ShortFormset = formset_factory ( form = ShortForm , extra = 1 ) #NEWLINE# formset = ShortFormset ( initial = [ { #NEWLINE# #INDENT# 'name' : 'Johnson' , #NEWLINE# 'age' : 23 , #NEWLINE# 'metadata' : 'Hidden details' , #NEWLINE# #UNINDENT# } ] ) #NEWLINE# rendered = render ( '{% form formset using "floppyforms/layouts/ul.html" %}' , { #NEWLINE# #INDENT# 'formset' : formset , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertHTMLEqual ( rendered , '\n        <li>\n            <label for="id_form-0-name">Your first name?</label>\n            <input type="text" name="form-0-name" value="Johnson" required id="id_form-0-name">\n        </li>\n        <li>\n            <label for="id_form-0-age">Age:</label>\n            <input type="number" name="form-0-age" value="23" id="id_form-0-age">\n            <input type="hidden" name="form-0-metadata" value="Hidden details" id="id_form-0-metadata">\n\n        </li>\n        <li>\n            <label for="id_form-1-name">Your first name?</label>\n            <input type="text" name="form-1-name" required id="id_form-1-name">\n        </li>\n        <li>\n            <label for="id_form-1-age">Age:</label>\n            <input type="number" name="form-1-age" id="id_form-1-age">\n            <input type="hidden" name="form-1-metadata" id="id_form-1-metadata">\n        </li>\n        ' )