#NEWLINE# def test_dump_load_data_content( self ) : #NEWLINE# #INDENT# '\n        Testing the dump / load with full dump of file content data\n        ' #NEWLINE# with SettingsOverride ( filer_settings , FILER_DUMP_PAYLOAD = True ) : #NEWLINE# #INDENT# create_folder_structure ( 1 , 1 ) #NEWLINE# fileobj = self . create_filer_file ( Folder . objects . all ( ) [ 0 ] ) #NEWLINE# jdata = StringIO ( ) #NEWLINE# fobj = tempfile . NamedTemporaryFile ( suffix = '.json' , delete = False ) #NEWLINE# call_command ( 'dumpdata' , 'filer' , stdout = jdata , indent = 3 ) #NEWLINE# complete = os . path . join ( fileobj . file . storage . location , fileobj . path ) #NEWLINE# os . unlink ( complete ) #NEWLINE# fileobj . delete ( ) #NEWLINE# fobj . write ( jdata . getvalue ( ) . encode ( 'utf-8' ) ) #NEWLINE# fobj . seek ( 0 ) #NEWLINE# call_command ( 'loaddata' , fobj . name , stdout = jdata ) #NEWLINE# self . assertEqual ( Folder . objects . all ( ) . count ( ) , 1 ) #NEWLINE# self . assertEqual ( File . objects . all ( ) . count ( ) , 1 ) #NEWLINE# self . assertEqual ( File . objects . all ( ) [ 0 ] . original_filename , self . image_name ) #NEWLINE# fileobj = File . objects . all ( ) [ 0 ] #NEWLINE# complete = os . path . join ( fileobj . file . storage . location , fileobj . path ) #NEWLINE# self . assertTrue ( os . path . exists ( complete ) )