]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Test fixes / coverage
authorshamoon <4887959+shamoon@users.noreply.github.com>
Mon, 7 Jul 2025 05:33:11 +0000 (22:33 -0700)
committershamoon <4887959+shamoon@users.noreply.github.com>
Tue, 8 Jul 2025 21:19:45 +0000 (14:19 -0700)
src/paperless_remote/tests/test_checks.py
src/paperless_remote/tests/test_parser.py

index b153df2241fbf1d4b77938ac4ad9fea7ac459d8c..ac65da27fd3b28d3c38ac16b299e8a2342e90032 100644 (file)
@@ -18,7 +18,7 @@ class TestChecks(TestCase):
         self.assertEqual(len(msgs), 1)
         self.assertTrue(
             msgs[0].msg.startswith(
-                "Azure AI Vision remote parser requires endpoint to be configured.",
+                "Azure AI remote parser requires endpoint to be configured.",
             ),
         )
 
index a70838c657c4d89bc7999b09f45a06ce8849d3d0..c471e503bc5660f67a4d9093cb0c599ced4fb156 100644 (file)
@@ -8,6 +8,7 @@ from django.test import override_settings
 from documents.tests.utils import DirectoriesMixin
 from documents.tests.utils import FileSystemAssertsMixin
 from paperless_remote.parsers import RemoteDocumentParser
+from paperless_remote.signals import get_parser
 
 
 class TestParser(DirectoriesMixin, FileSystemAssertsMixin, TestCase):
@@ -56,7 +57,7 @@ class TestParser(DirectoriesMixin, FileSystemAssertsMixin, TestCase):
             REMOTE_OCR_API_KEY="somekey",
             REMOTE_OCR_ENDPOINT="https://endpoint.cognitiveservices.azure.com",
         ):
-            parser = RemoteDocumentParser(uuid.uuid4())
+            parser = get_parser(uuid.uuid4())
             parser.parse(
                 self.SAMPLE_FILES / "simple-digital.pdf",
                 "application/pdf",
@@ -86,7 +87,7 @@ class TestParser(DirectoriesMixin, FileSystemAssertsMixin, TestCase):
         self.assertEqual(parser.supported_mime_types(), expected_types)
 
     def test_supported_mime_types_invalid_config(self):
-        parser = RemoteDocumentParser(uuid.uuid4())
+        parser = get_parser(uuid.uuid4())
         # with override_settings(
         #     REMOTE_OCR_ENGINE=None,
         #     REMOTE_OCR_API_KEY=None,
@@ -100,6 +101,6 @@ class TestParser(DirectoriesMixin, FileSystemAssertsMixin, TestCase):
         REMOTE_OCR_ENDPOINT=None,
     )
     def test_parse_with_invalid_config(self):
-        parser = RemoteDocumentParser(uuid.uuid4())
+        parser = get_parser(uuid.uuid4())
         parser.parse(self.SAMPLE_FILES / "simple-digital.pdf", "application/pdf")
         self.assertEqual(parser.text, "")