Chore: Move unittest directory setup onto the shared fixture

The unittest side of the suite built its temp directory tree with
tempfile.mkdtemp and a manually enabled override_settings, cleaned up only if
tearDown ran. That is now gone. DirectoriesMixin lives alongside the layout it
bridges and does nothing but hand the paperless_dirs fixture to TestCase
subclasses as self.dirs, so both halves of the suite get the same twelve
settings, the same directory shapes and cleanup owned by tmp_path.

The mixin moves to paperless_testing.dirs rather than staying in the documents
test utilities, because modules in paperless and paperless_mail import it
across the app boundary. The thirty-eight consuming modules change only their
import line; self.dirs.scratch_dir and its siblings keep working.
This commit is contained in:
stumpylog
2026-09-21 08:08:49 -07:00
parent 768ca6b49a
commit e9b56abfe9
41 changed files with 87 additions and 144 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ from documents.models import DocumentType
from documents.models import StoragePath
from documents.models import Tag
from documents.permissions import set_permissions_for_objects
from documents.tests.utils import DirectoriesMixin
from paperless_testing.dirs import DirectoriesMixin
class TestBulkEdit(DirectoriesMixin, TestCase):