test and write method for deleting portfolios