def METHOD_NAME(self, mocker, jt_count, j_count, inv_count, sched_count, wfnode_count, wfnodej_count, expected):
    counts = [jt_count, j_count, inv_count, sched_count, wfnode_count, wfnodej_count]
    models = [UnifiedJobTemplate, UnifiedJob, Inventory, Schedule, WorkflowJobTemplateNode, WorkflowJobNode]
    mockers = []
    for index in range(0, len(models)):
        a_mocker = mocker.MagicMock()
        a_mocker.count = mocker.MagicMock(return_value=counts[index])
        mocker.patch.object(models[index], 'objects', mocker.MagicMock(filter=mocker.MagicMock(return_value=a_mocker)))
        mockers.append(a_mocker)
    label = Label(id=37)
    ret = label.is_candidate_for_detach()
    for index in range(0, len(models)):
        models[index].objects.filter.assert_called_with(labels__in=[label.id])
    for index in range(0, len(mockers)):
        mockers[index].count.assert_called_with()
    assert ret is expected