]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
fix(parsers|test_api): fix failed tests
authorMatthias Eck <matthias.eck93@gmail.com>
Sat, 6 Aug 2022 17:17:59 +0000 (17:17 +0000)
committerMatthias Eck <matthias.eck93@gmail.com>
Sat, 6 Aug 2022 17:19:10 +0000 (19:19 +0200)
src/documents/parsers.py
src/documents/tests/test_api.py

index 26a4e11c65fab77fa74bb9a5485c53d599332d2a..f621996775699480e35f0a5ba5077d4e5d43b9b2 100644 (file)
@@ -7,6 +7,7 @@ import shutil
 import subprocess
 import tempfile
 from typing import Iterator
+from typing import Match
 from typing import Optional
 from typing import Set
 
@@ -252,7 +253,7 @@ def parse_date_generator(filename, text) -> Iterator[datetime.datetime]:
         return None
 
     def __process_match(
-        match: re.Match[str],
+        match: Match[str],
         date_order: str,
     ) -> Optional[datetime.datetime]:
         date_string = match.group(0)
index bf30615209258bdb3dccc78348cf272b645a8a84..b6fa6969940bfa4c23efe3adfd1afb4cd72229d1 100644 (file)
@@ -1119,6 +1119,7 @@ class TestDocumentApi(DirectoriesMixin, APITestCase):
     @mock.patch("documents.views.match_document_types")
     @mock.patch("documents.views.match_tags")
     @mock.patch("documents.views.match_correspondents")
+    @override_settings(NUMBER_OF_SUGGESTED_DATES=10)
     def test_get_suggestions(
         self,
         match_correspondents,