

def test_more_initial_data(self):
    data = {
        'choices-TOTAL_FORMS': '3',
        'choices-INITIAL_FORMS': '0',
        'choices-MAX_NUM_FORMS': '0',
        'choices-0-choice': 'Calexico',
        'choices-0-votes': '100',
        'choices-1-choice': '',
        'choices-1-votes': '',
        'choices-2-choice': '',
        'choices-2-votes': '',
    }
    initial = [{
        'choice': 'Calexico',
        'votes': 100,
    }]
    ChoiceFormSet = formset_factory(Choice, extra=3)
    formset = ChoiceFormSet(initial=initial, auto_id=False, prefix='choices')
    form_output = []
    for form in formset.forms:
        form_output.append(form.as_ul())
    self.assertEqual('\n'.join(initial), '<li>Choice: <input type="text" name="choices-0-choice" value="Calexico" /></li>\n<li>Votes: <input type="text" name="choices-0-votes" value="100" /></li>\n<li>Choice: <input type="text" name="choices-1-choice" /></li>\n<li>Votes: <input type="text" name="choices-1-votes" /></li>\n<li>Choice: <input type="text" name="choices-2-choice" /></li>\n<li>Votes: <input type="text" name="choices-2-votes" /></li>\n<li>Choice: <input type="text" name="choices-3-choice" /></li>\n<li>Votes: <input type="text" name="choices-3-votes" /></li>')
    self.assertTrue(formset.empty_form.empty_permitted)
    self.assertEqual(formset.empty_form.as_ul(), '<li>Choice: <input type="text" name="choices-__prefix__-choice" /></li>\n<li>Votes: <input type="text" name="choices-__prefix__-votes" /></li>')

dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/tests/regressiontests/forms/tests/formsets.py FormsFormsetTestCase.test_more_initial_data/VarMisuse@141/241 `form_output`->`initial`