#NEWLINE# def test_accept( self ) : #NEWLINE# #INDENT# class _Form ( Form ) : #NEWLINE# #INDENT# fields = [ FieldBlock ( 'field block' , [ Field ( 'number' , convs . Int ( ) ) ] ) ] #NEWLINE# #UNINDENT# env = AppEnvironment . create ( ) #NEWLINE# form = _Form ( env ) #NEWLINE# self . assertEqual ( form . raw_data , MultiDict ( [ ( 'number' , '' ) ] ) ) #NEWLINE# self . assertEqual ( form . python_data , { #NEWLINE# #INDENT# 'number' : None , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assert_ ( form . accept ( { #NEWLINE# #INDENT# 'number' : '4' , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# self . assertEqual ( form . python_data , { #NEWLINE# #INDENT# 'number' : 4 , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( form . get_field ( 'number' ) . raw_value , '4' ) #NEWLINE# self . assertEqual ( form . errors , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } )