from core.middleware import _is_token_issue_message


def test_is_token_issue_message_detects_expired_token_in_spanish():
    assert _is_token_issue_message("Token inválido o expirado") is True


def test_is_token_issue_message_detects_expired_token_in_english():
    assert _is_token_issue_message("Invalid or expired token") is True


def test_is_token_issue_message_detects_detail_reason_combo():
    assert _is_token_issue_message(
        "Access denied",
        "jwt signature validation failed",
        "token malformed",
    ) is True


def test_is_token_issue_message_does_not_flag_real_license_error():
    assert _is_token_issue_message("Sin licencia asignada para este tenant") is False
