'Context manager for mocking del_msg.'

def mock_del_msg(self, thing, ret=True):

    return contextlib.nested(patch.object(VByName, 'run', return_value=(thing if ret else None)), patch.object(VModhash, 'run', side_effect=None), patch.object(VUser, 'run', side_effect=None), patch.object(thing, '_commit', side_effect=None), patch.object(Account, '_id', self.id, create=True), patch.object(g.events, 'message_event', side_effect=None))
