#NEWLINE# def test_custom_converter( self ) : #NEWLINE# #INDENT# csv_data = StringIO ( '\r\n' . join ( ( 'username,enabled,last_login' , 'charlie,TRUE,2015-01-02 00:00:00' , 'huey,FALSE,2015-02-03 00:00:00' , 'zaizee,,2015-03-04 00:00:00' ) ) ) #NEWLINE# converter = TestBooleanRowConverter ( ModelClass . db ) #NEWLINE# ModelClass = load_csv ( self . db , csv_data , converter = converter ) #NEWLINE# self . assertEqual ( sorted ( ModelClass . _meta . fields . keys ( ) ) , [ '_auto_pk' , 'enabled' , 'last_login' , 'username' ] ) #NEWLINE# self . assertTrue ( isinstance ( ModelClass . enabled , BooleanField ) ) #NEWLINE# self . assertTrue ( isinstance ( ModelClass . last_login , DateTimeField ) ) #NEWLINE# self . assertTrue ( isinstance ( ModelClass . username , BareField ) )