#NEWLINE# def test_toElementRequired( self ) : #NEWLINE# #INDENT# '\n        Test rendering to a DOM with options.\n        ' #NEWLINE# field = data_form . Field ( var = 'test' , required = True ) #NEWLINE# element = field . toElement ( True ) #NEWLINE# self . assertEqual ( 1 , len ( element . children ) ) #NEWLINE# child = element . children [ 0 ] #NEWLINE# self . assertEqual ( 'required' , child . name ) #NEWLINE# self . assertEqual ( NS_X_DATA , child . uri )