mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-09-22 09:28:32 +00:00
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:
@@ -64,13 +64,13 @@ from documents.models import WorkflowTrigger
|
||||
from documents.plugins.base import StopConsumeTaskError
|
||||
from documents.serialisers import WorkflowTriggerSerializer
|
||||
from documents.signals import document_consumption_finished
|
||||
from documents.tests.utils import DirectoriesMixin
|
||||
from documents.tests.utils import DummyProgressManager
|
||||
from documents.tests.utils import FileSystemAssertsMixin
|
||||
from documents.tests.utils import SampleDirMixin
|
||||
from documents.workflows.actions import execute_password_removal_action
|
||||
from paperless_mail.models import MailAccount
|
||||
from paperless_mail.models import MailRule
|
||||
from paperless_testing.dirs import DirectoriesMixin
|
||||
|
||||
|
||||
class TestWorkflows(
|
||||
|
||||
Reference in New Issue
Block a user