#NEWLINE# def test_fromElementTwoFields( self ) : #NEWLINE# #INDENT# element = domish . Element ( ( NS_X_DATA , 'x' ) ) #NEWLINE# element . addElement ( 'field' ) [ 'var' ] = 'field1' #NEWLINE# element . addElement ( 'field' ) [ 'var' ] = 'field2' #NEWLINE# form = data_form . Form . fromElement ( element ) #NEWLINE# self . assertEquals ( 2 , len ( form . fieldList ) ) #NEWLINE# self . assertIn ( 'field1' , form . fields ) #NEWLINE# self . assertEquals ( 'field1' , form . fieldList [ 0 ] . var ) #NEWLINE# self . assertIn ( 'field2' , form . fields ) #NEWLINE# self . assertEquals ( 'field2' , form . fieldList [ 1 ] . var )