fix bugs and test cases

This commit is contained in:
jonaswinkler 2021-01-02 15:37:27 +01:00
parent 520f92503f
commit 89d6e422f5
2 changed files with 4 additions and 2 deletions

View File

@ -100,7 +100,9 @@ def generate_filename(doc, counter=0):
many_to_dictionary(doc.tags))
tag_list = pathvalidate.sanitize_filename(
",".join([tag.name for tag in doc.tags.all()]),
",".join(sorted(
[tag.name for tag in doc.tags.all()]
)),
replacement_text="-"
)

View File

@ -78,7 +78,7 @@ class TestParser(DirectoriesMixin, TestCase):
parser.get_thumbnail(os.path.join(self.SAMPLE_FILES, 'simple-digital.pdf'), "application/pdf")
# dont really know how to test it, just call it and assert that it does not raise anything.
@mock.patch("paperless_tesseract.parsers.run_convert")
@mock.patch("documents.parsers.run_convert")
def test_thumbnail_fallback(self, m):
def call_convert(input_file, output_file, **kwargs):