From: Matthias Eck Date: Sat, 6 Aug 2022 17:17:59 +0000 (+0000) Subject: fix(parsers|test_api): fix failed tests X-Git-Tag: v1.9.0-beta.rc1~27^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d0a26fdb1793de1a4d4e023c1ec83bac38a0079;p=thirdparty%2Fpaperless-ngx.git fix(parsers|test_api): fix failed tests --- diff --git a/src/documents/parsers.py b/src/documents/parsers.py index 26a4e11c65..f621996775 100644 --- a/src/documents/parsers.py +++ b/src/documents/parsers.py @@ -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) diff --git a/src/documents/tests/test_api.py b/src/documents/tests/test_api.py index bf30615209..b6fa696994 100644 --- a/src/documents/tests/test_api.py +++ b/src/documents/tests/test_api.py @@ -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,