def unset_public_report(report_id): """ Deletes the specified report from disk, and sets the public flag to False. """ # call would throw an exception if report cannot be made private PersistentReport.make_report_private(report_id, current_user.id, g.file_manager) return json_response(message='Update successful')
def test_make_private_report(self): """ Making a report private should try to delete it """ file_manager = Mock(spec=PublicReportFileManager) report_path = file_manager.get_public_report_path(self.reports[0].id) PersistentReport.make_report_private( self.reports[0].id, self.reports[0].user_id, file_manager ) file_manager.remove_file.assert_called_with(report_path)