diff --git a/tests/gateway/test_discord_document_handling.py b/tests/gateway/test_discord_document_handling.py index c9f8f53c2835..39b69dedca20 100644 --- a/tests/gateway/test_discord_document_handling.py +++ b/tests/gateway/test_discord_document_handling.py @@ -97,6 +97,9 @@ def _redirect_cache(tmp_path, monkeypatch): def adapter(monkeypatch): monkeypatch.setattr(discord_platform.discord, "DMChannel", FakeDMChannel, raising=False) monkeypatch.setattr(discord_platform.discord, "Thread", FakeThread, raising=False) + # These tests mock the actual download. Do not let host DNS/proxy mappings + # for cdn.discordapp.com decide whether document handling is exercised. + monkeypatch.setattr(discord_platform, "is_safe_url", lambda _url: True) config = PlatformConfig(enabled=True, token="fake-token") a = DiscordAdapter(config)