#NEWLINE# def test_custom_form( self ) : #NEWLINE# #INDENT# ' Test that model_formset respects fields and exclude parameters of\n            custom form\n        ' #NEWLINE# class PostForm1 ( forms . ModelForm ) : #NEWLINE# #INDENT# class Meta ( ) : #NEWLINE# #INDENT# model = Post #NEWLINE# fields = ( 'title' , 'posted' ) #NEWLINE# #UNINDENT# #UNINDENT# class PostForm2 ( forms . ModelForm ) : #NEWLINE# #INDENT# class Meta ( ) : #NEWLINE# #INDENT# model = Post #NEWLINE# exclude = ( 'subtitle' , ) #NEWLINE# #UNINDENT# #UNINDENT# PostFormSet = modelformset_factory ( Post , form = PostForm1 ) #NEWLINE# formset = PostFormSet ( ) #NEWLINE# self . assertFalse ( ( 'subtitle' in formset . forms [ 0 ] . fields ) ) #NEWLINE# PostFormSet = modelformset_factory ( Post , form = PostForm2 ) #NEWLINE# formset = PostFormSet ( ) #NEWLINE# self . assertFalse ( ( 'subtitle' in self . forms [ 0 ] . fields ) )