#NEWLINE# def test_typeCheckUnknownRemoved( self ) : #NEWLINE# #INDENT# '\n        Unknown fields are not checked, and removed if filterUnknown True.\n        ' #NEWLINE# checked = [ ] #NEWLINE# fieldDefs = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# form = data_form . Form ( 'submit' ) #NEWLINE# form . addField ( data_form . Field ( 'list-single' , var = 'pubsub#description' , value = 'a node' ) ) #NEWLINE# field = checked . fields [ 'pubsub#description' ] #NEWLINE# field . typeCheck = ( lambda : checked . append ( None ) ) #NEWLINE# form . typeCheck ( fieldDefs , filterUnknown = True ) #NEWLINE# self . assertNotIn ( 'pubsub#description' , form . fields ) #NEWLINE# self . assertEqual ( [ ] , checked )