'Updates requires column of resources.
Required for testing the generation of convergence dependency graph
on an update.'

def _mock_convg_db_update_requires(self):

    requires = dict()
    for (rsrc_id, is_update) in self.stack.convergence_dependencies:
        if is_update:
            reqs = self.stack.convergence_dependencies.requires((rsrc_id, is_update))
            requires[rsrc_id] = list({id for (id, is_update) in reqs})
    rsrcs_db = resource_objects.Resource.get_all_active_by_stack(self.stack.context, self.stack.id)
    for (rsrc_id, rsrc) in rsrcs_db.items():
        if (rsrc.id in requires):
            rsrcs_db[rsrc_id].requires = requires[rsrc.id]
    return rsrcs_db
