A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Remove temporary directories after failed tests
Wolf-Bastian Poettnerab908fee43e6
diff --git a/src/documents/tests/test_file_handling.py b/src/documents/tests/test_file_handling.pyindex 0da2c27e7..1dbe1ca18 100644--- a/src/documents/tests/test_file_handling.py+++ b/src/documents/tests/test_file_handling.py@@ -4,6 +4,7 @@ import shutilfrom unittest import mockfrom uuid import uuid4from pathlib import Path+from shutil import rmtreefrom dateutil import tzfrom django.test import TestCase, override_settings@@ -14,6 +15,19 @@ from django.conf import settingsclass TestDate(TestCase):+ def tearDown(self):+ # Delete all temporary directories from failed tests+ root = os.path.normpath("/tmp")++ for filename in os.listdir(root):+ fullname = os.path.join(root, filename)++ if not os.path.isdir(fullname):+ continue++ if filename.startswith("paperless-tests-"):+ shutil.rmtree(fullname, ignore_errors=True)+@override_settings(PAPERLESS_FILENAME_FORMAT="")def test_source_filename(self):document = Document()