#NEWLINE# def test_prepare_xml_data_integer( self ) : #NEWLINE# #INDENT# def to_int( string ) : #NEWLINE# #INDENT# if ( string == 'One' ) : #NEWLINE# #INDENT# return '1' #NEWLINE# #UNINDENT# return string #NEWLINE# #UNINDENT# xml = '<data><val>One</val></data>' #NEWLINE# int_field = XMLIntegerField ( path = 'val' , prepare = to_int , root = None ) #NEWLINE# self . assertEquals ( int_field . get_prep_value ( to_int ) , 1 )