#NEWLINE# def test_toElementFormType( self ) : #NEWLINE# #INDENT# '\n        The form type is rendered as a hidden field with name FORM_TYPE.\n        ' #NEWLINE# form = data_form . Form ( 'form' , formNamespace = 'jabber:bot' ) #NEWLINE# element = form . toElement ( ) #NEWLINE# elements = list ( element . elements ( ) ) #NEWLINE# self . assertEqual ( 1 , len ( elements ) ) #NEWLINE# formTypeField = elements [ 0 ] #NEWLINE# self . assertEqual ( 'field' , formTypeField . name ) #NEWLINE# self . assertEqual ( NS_X_DATA , formTypeField . uri ) #NEWLINE# self . assertEqual ( 'FORM_TYPE' , formTypeField [ 'var' ] ) #NEWLINE# self . assertEqual ( 'hidden' , formTypeField [ 'type' ] ) #NEWLINE# self . assertEqual ( 'jabber:bot' , unicode ( formTypeField . value ) )