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