#NEWLINE# def _test_form_mixin_add_to_field_header( self , add_field = False ) : #NEWLINE# #INDENT# options = dict ( HTTP_X_REQUESTED_WITH = 'XMLHttpRequest' ) #NEWLINE# if add_field : #NEWLINE# #INDENT# options [ forms . views . ADD_TO_FIELD_HEADER ] = 'keepme' #NEWLINE# #UNINDENT# view = self . _prepare_view ( forms . views . ModalFormView , options ) #NEWLINE# context = view . get_context_data ( ) #NEWLINE# if add_field : #NEWLINE# #INDENT# self . assertEqual ( context [ 'add_to_field' ] , 'keepme' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . assertNotIn ( 'add_to_field' , context )