#NEWLINE# def test_init( self ) : #NEWLINE# #INDENT# 'Initialization of form object' #NEWLINE# class F ( Form ) : #NEWLINE# #INDENT# fields = [ Field ( 'first' , permissions = 'rw' ) , Field ( 'second' ) ] #NEWLINE# #UNINDENT# env = AppEnvironment . create ( ) #NEWLINE# form = F ( env , permissions = 'rwx' ) #NEWLINE# self . assertEqual ( form . permissions , set ( 'rwx' ) ) #NEWLINE# self . assertEqual ( form . get_field ( 'second' ) . permissions , set ( 'rwx' ) ) #NEWLINE# self . assertEqual ( form . get_field ( 'first' ) . permissions , set ( 'rw' ) ) #NEWLINE# form = F ( env , permissions = 'r' ) #NEWLINE# self . assertEqual ( form . permissions , set ( 'r' ) ) #NEWLINE# self . assertEqual ( form . get_field ( 'second' ) . permissions , set ( 'r' ) ) #NEWLINE# self . assertEqual ( form . get_field ( 'first' ) . permissions , set ( 'r' ) )