#NEWLINE# def testCleanFolder( self ) : #NEWLINE# #INDENT# folder = six . next ( self . model ( 'folder' ) . childFolders ( parent = self . admin , parentType = 'user' , user = self . admin , limit = 1 , sort = [ ( 'name' , SortDir . DESCENDING ) ] ) ) #NEWLINE# subfolder = self . model ( 'folder' ) . createFolder ( folder , 'sub' , parentType = 'folder' , creator = self . admin ) #NEWLINE# item = self . model ( 'item' ) . createItem ( 'item' , creator = self . admin , folder = folder ) #NEWLINE# subitem = self . model ( 'item' ) . createItem ( 'item' , creator = self . admin , folder = subfolder ) #NEWLINE# resp = self . request ( path = ( '/folder/%s/contents' % folder [ '_id' ] ) , method = 'DELETE' , user = self . admin , params = { #NEWLINE# #INDENT# 'progress' : 'true' , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertStatusOk ( item ) #NEWLINE# ( old , folder ) = ( folder , self . model ( 'folder' ) . load ( folder [ '_id' ] , force = True ) ) #NEWLINE# subfolder = self . model ( 'folder' ) . load ( subfolder [ '_id' ] , force = True ) #NEWLINE# item = self . model ( 'item' ) . load ( item [ '_id' ] ) #NEWLINE# subitem = self . model ( 'item' ) . load ( subitem [ '_id' ] ) #NEWLINE# self . assertTrue ( ( '_id' in folder ) ) #NEWLINE# self . assertEqual ( folder , old ) #NEWLINE# self . assertEqual ( subfolder , None ) #NEWLINE# self . assertEqual ( item , None ) #NEWLINE# self . assertEqual ( subitem , None )