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.
The model factories lived in the documents test package, but three other
apps needed them. The AI, mail and testing suites all reached across an app
boundary to import from documents.tests.factories, which made a private test
package into a shared dependency.
The factories now live in the shared testing package, where cross-app use is
the intended use.
ProcessedMailViewSet.bulk_delete checked permissions inside the delete loop, so an unpermitted id returned 403 only after the mails ahead of it had already been deleted. Resolve the permitted set once via permitted_object_ids and reject before deleting anything, which also drops the per-mail permission queries.
* Adds new filtering to exclude attachments from processing
* Frontend use include / exclude mail rule filename filters
---------
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
* Initial implementation of consumption templates
* Frontend implementation of consumption templates
Testing
* Support consumption template source
* order templates, automatically add permissions
* Support title assignment in consumption templates
* Refactoring, filters to and, show sources on list
Show sources on template list, update some translation strings
Make filters and
minor testing
* Update strings
* Only update django-multiselectfield
* Basic docs, document some methods
* Improve testing coverage, template multi-assignment merges