def test_increase_hard_limit(self):
        # reduce the default limit of 1000 temporarily for testing
        _old_DEFAULT_MAX_NUM = formsets.DEFAULT_MAX_NUM
        try:
            formsets.DEFAULT_MAX_NUM = 3
            # for this form, we want a limit of 4
            ChoiceFormSet = formset_factory(Choice, max_num=4)
            formset = ChoiceFormSet(
                {
                    'choices-TOTAL_FORMS': '4',
                    'choices-INITIAL_FORMS': '0',
                    'choices-MAX_NUM_FORMS': '4',
                    'choices-0-choice': 'Zero',
                    'choices-0-votes': '0',
                    'choices-1-choice': 'One',
                    'choices-1-votes': '1',
                    'choices-2-choice': 'Two',
                    'choices-2-votes': '2',
                    'choices-3-choice': 'Three',
                    'choices-3-votes': '3',
                    },
                prefix='choices',
                )
            # Four forms are instantiated and no exception is raised
            self.assertEqual(len(formset.forms), 4)
        finally:
            formsets.DEFAULT_MAX_NUM = _old_DEFAULT_MAX_NUM
Can increase the built-in forms limit via a higher max_num.
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/Django-1.6.10/tests/forms_tests/tests/test_formsets.py/FormsFormsetTestCase.test_increase_hard_limit