From f3f52277761f31dfa10ccc256ff26faac37c0ef1 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Tue, 1 Dec 2020 23:54:33 +0100 Subject: [PATCH] fix some tests. --- src/documents/tests/test_parsers.py | 5 ++++- src/documents/tests/test_post_consume_handlers.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/documents/tests/test_parsers.py b/src/documents/tests/test_parsers.py index f30647b57..27791f992 100644 --- a/src/documents/tests/test_parsers.py +++ b/src/documents/tests/test_parsers.py @@ -7,7 +7,7 @@ from unittest import mock from django.test import TestCase, override_settings from documents.parsers import get_parser_class, get_supported_file_extensions, get_default_file_extension, \ - get_parser_class_for_mime_type, DocumentParser + get_parser_class_for_mime_type, DocumentParser, is_file_ext_supported from paperless_tesseract.parsers import RasterisedDocumentParser from paperless_text.parsers import TextDocumentParser @@ -116,3 +116,6 @@ class TestParserAvailability(TestCase): self.assertEqual(get_parser_class_for_mime_type('application/pdf'), RasterisedDocumentParser) self.assertEqual(get_parser_class_for_mime_type('text/plain'), TextDocumentParser) self.assertEqual(get_parser_class_for_mime_type('text/sdgsdf'), None) + + self.assertTrue(is_file_ext_supported('.pdf')) + self.assertFalse(is_file_ext_supported('.hsdfh')) diff --git a/src/documents/tests/test_post_consume_handlers.py b/src/documents/tests/test_post_consume_handlers.py index aa712832a..fb4c9fc12 100644 --- a/src/documents/tests/test_post_consume_handlers.py +++ b/src/documents/tests/test_post_consume_handlers.py @@ -32,7 +32,7 @@ class PostConsumeTestCase(TestCase): @mock.patch("documents.signals.handlers.Popen") @override_settings(POST_CONSUME_SCRIPT="script") - def test_post_consume_script_simple(self, m): + def test_post_consume_script_with_correspondent(self, m): c = Correspondent.objects.create(name="my_bank") doc = Document.objects.create(title="Test", mime_type="application/pdf", correspondent=c) tag1 = Tag.objects.create(name="a")