]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Chore: replace test image URLs to our own files (#11390)
authorshamoon <4887959+shamoon@users.noreply.github.com>
Mon, 17 Nov 2025 18:22:54 +0000 (10:22 -0800)
committerGitHub <noreply@github.com>
Mon, 17 Nov 2025 18:22:54 +0000 (10:22 -0800)
src/paperless_mail/tests/samples/html.eml
src/paperless_mail/tests/samples/sample.html
src/paperless_mail/tests/test_parsers_live.py

index 97747ceabfc89ea857caab9047f4bd771f686a3a..aaac68cc4e0358739fc9ac9b9438e3d1a2946595 100644 (file)
@@ -55,7 +55,7 @@ Content-Transfer-Encoding: 7bit
                <p>Some Text</p>
                <p>
                        <img src="cid:part1.pNdUSz0s.D3NqVtPg@example.de" alt="Has to be rewritten to work..">
-                       <img src="https://upload.wikimedia.org/wikipedia/en/f/f7/RickRoll.png" alt="This image should not be shown.">
+                       <img src="https://docs.paperless-ngx.com/assets/logo_full_white.svg" alt="This image should not be shown.">
                </p>
 
                <p>and an embedded image.<br>
index 584cd5d64080b8626cadb5f1c02caabe95fad923..c1fd52d4323a630b76bea7e74bcf3bec11d63173 100644 (file)
@@ -6,7 +6,7 @@
       <p>Some Text</p>
       <p>
                                <img src="cid:part1.pNdUSz0s.D3NqVtPg@example.de" alt="Has to be rewritten to work..">
-                               <img src="https://upload.wikimedia.org/wikipedia/en/f/f7/RickRoll.png" alt="This image should not be shown.">
+                               <img src="https://docs.paperless-ngx.com/assets/logo_full_white.svg" alt="This image should not be shown.">
                        </p>
 
       <p>and an embedded image.<br>
index 456cb47d50945c11a65e99a21cee77f929257368..fd052cc262050aaa481fcb33c9bf92fd7332895c 100644 (file)
@@ -2,7 +2,6 @@ import os
 import shutil
 import subprocess
 import tempfile
-import time
 from pathlib import Path
 
 import httpx
@@ -54,34 +53,6 @@ class TestUrlCanary:
     Verify certain URLs are still available so testing is valid still
     """
 
-    @classmethod
-    def _fetch_wikimedia(cls, url: str) -> httpx.Response:
-        """
-        Wikimedia occasionally throttles automated requests (HTTP 429). Retry a few
-        times with a short backoff so the tests stay stable, and skip if throttling
-        persists.
-        """
-        last_resp: httpx.Response | None = None
-        # Wikimedia rejects requests without a browser-like User-Agent header and returns 403.
-        headers = {
-            "User-Agent": (
-                "Mozilla/5.0 (X11; Linux x86_64) "
-                "AppleWebKit/537.36 (KHTML, like Gecko) "
-                "Chrome/123.0.0.0 Safari/537.36"
-            ),
-        }
-        for delay in (0, 1, 2):
-            resp = httpx.get(url, headers=headers, timeout=30.0)
-            if resp.status_code != httpx.codes.TOO_MANY_REQUESTS:
-                return resp
-            last_resp = resp
-            time.sleep(delay)
-
-        pytest.skip(
-            "Wikimedia throttled the canary request with HTTP 429; try rerunning later.",
-        )
-        return last_resp  # pragma: no cover
-
     def test_online_image_exception_on_not_available(self):
         """
         GIVEN:
@@ -96,8 +67,8 @@ class TestUrlCanary:
         whether this image stays online forever, so here we check if we can detect if is not
         available anymore.
         """
-        resp = self._fetch_wikimedia(
-            "https://upload.wikimedia.org/wikipedia/en/f/f7/nonexistent.png",
+        resp = httpx.get(
+            "https://docs.paperless-ngx.com/assets/non-existent.png",
         )
         with pytest.raises(httpx.HTTPStatusError) as exec_info:
             resp.raise_for_status()
@@ -119,8 +90,8 @@ class TestUrlCanary:
         """
 
         # Now check the URL used in samples/sample.html
-        resp = self._fetch_wikimedia(
-            "https://upload.wikimedia.org/wikipedia/en/f/f7/RickRoll.png",
+        resp = httpx.get(
+            "https://docs.paperless-ngx.com/assets/logo_full_white.svg",
         )
         resp.raise_for_status()