def METHOD_NAME(self, add_access):
    add_access.side_effect = Exception('Fake error')
    task = mommy.make('TaskHistory')
    self.assertIsNone(task.details)
    self.assertFalse(purge_unused_exports(task))
    self.assertIn('Removing: {}'.format(self.export), task.details)
    self.assertIn('Error: Fake error'.format(self.export), task.details)