def test_send_pull_request_target_branch_with_additional_message(
    mock_get, mock_post, mock_run, mock_issue, mock_output_dir
):
    """Test that target_branch works correctly with additional PR message."""
    repo_path = os.path.join(mock_output_dir, 'repo')
    target_branch = 'feature-branch'
    additional_message = 'Additional PR context'

    # Mock API responses
    mock_get.side_effect = [
        MagicMock(status_code=404),  # Branch doesn't exist
        MagicMock(status_code=200),  # Target branch exists
    ]

    mock_post.return_value.json.return_value = {
        'html_url': 'https://github.com/test-owner/test-repo/pull/1'
    }

    # Mock subprocess.run calls
    mock_run.side_effect = [
        MagicMock(returncode=0),  # git checkout -b
        MagicMock(returncode=0),  # git push
    ]

    # Call the function with target_branch and additional_message
    send_pull_request(
        issue=mock_issue,
        token='test-token',
        username='test-user',
        platform=ProviderType.GITHUB,
        patch_dir=repo_path,
        pr_type='ready',
        target_branch=target_branch,
        additional_message=additional_message,
    )

    # Assert API calls
    assert mock_get.call_count == 2

    # Check PR creation
    mock_post.assert_called_once()
    post_data = mock_post.call_args[1]['json']
    assert post_data['base'] == target_branch
    assert additional_message in post_data['body']
    assert 'This pull request fixes #42' in post_data['body']
Test that target_branch works correctly with additional PR message.
tests/unit/resolver/github/test_send_pull_request.py