def test_can_merge(self, MR): mr = M.MergeRequest(_id='_id') MR.query.get.return_value = mr repo_tasks.can_merge(mr._id) mr.app.repo.can_merge.assert_called_once_with(mr) val = mr.app.repo.can_merge.return_value mr.set_can_merge_cache.assert_called_once_with(val)