Fix: Update filename correctly if the document is in the trash (#8066)

* Fixes an issue where the filename is not updated if the document is in the trash (but the file is moved)
This commit is contained in:
Trenton H
2024-10-27 19:45:31 -07:00
committed by GitHub
parent ad23cce2e6
commit 335c6c3820
2 changed files with 7 additions and 3 deletions

View File

@@ -150,7 +150,7 @@ class TestFileHandling(DirectoriesMixin, FileSystemAssertsMixin, TestCase):
with (
mock.patch(
"documents.signals.handlers.Document.objects.filter",
"documents.signals.handlers.Document.global_objects.filter",
) as m,
disable_auditlog(),
):
@@ -865,7 +865,9 @@ class TestFileHandlingWithArchive(DirectoriesMixin, FileSystemAssertsMixin, Test
archive_filename="0000001.pdf",
archive_checksum="B",
)
with mock.patch("documents.signals.handlers.Document.objects.filter") as m:
with mock.patch(
"documents.signals.handlers.Document.global_objects.filter",
) as m:
m.side_effect = DatabaseError()
doc.save()