def METHOD_NAME(monkeypatch, run_cli_command):
    """Test the ``tasks analyze`` command when there are duplicate tasks."""
    monkeypatch.setattr(cmd_rabbitmq, 'get_active_processes', lambda *args: [1, 2])
    monkeypatch.setattr(cmd_rabbitmq, 'get_process_tasks', lambda *args: [1, 2, 2])
    result = run_cli_command(cmd_rabbitmq.cmd_tasks_analyze, raises=True, use_subprocess=False)
    assert 'There are duplicates process tasks:' in result.output
    assert 'Inconsistencies detected between database and RabbitMQ.' in result.output