  
  
  class FormsFormsetTestCase(SimpleTestCase):
  
      def make_choiceformset(self, formset_data=None, formset_class=ChoiceFormSet,
              total_forms=None, initial_forms=0, max_num_forms=0, min_num_forms=0, **kwargs):
          """
          Make a ChoiceFormset from the given formset_data.
 
</s> remove         forms = [self._construct_form(i) for i in range(self.total_form_count())]
 </s> add         forms = [self._construct_form(i, **self.get_form_kwargs(i))
                 for i in range(self.total_form_count())] </s> remove                  initial=None, error_class=ErrorList):
 </s> add                  initial=None, error_class=ErrorList, form_kwargs=None):
class CustomKwargForm(Form):
    def __init__(self, *args, **kwargs):
        self.custom_kwarg = kwargs.pop('custom_kwarg')
        super(CustomKwargForm, self).__init__(*args, **kwargs)


  
  
class CustomKwargForm(Form):
    def __init__(self, *args, **kwargs):
        self.custom_kwarg = kwargs.pop('custom_kwarg')
        super(CustomKwargForm, self).__init__(*args, **kwargs)


  class FormsFormsetTestCase(SimpleTestCase):
  
      def make_choiceformset(self, formset_data=None, formset_class=ChoiceFormSet,
              total_forms=None, initial_forms=0, max_num_forms=0, min_num_forms=0, **kwargs):
          """
          Make a ChoiceFormset from the given formset_data.
keep add keep keep keep keep keep keep
 Fixed #18166 -- Added form_kwargs support to formsets.

By specifying form_kwargs when instantiating the formset, or overriding
the `get_form_kwargs` method on a formset class, you can pass extra
keyword arguments to the underlying `Form` instances.

Includes tests and documentation update. 
tests/forms_tests/tests/test_formsets.py