Fix: ignore logo file from sanity checker (#9946)

This commit is contained in:
shamoon
2025-05-16 17:30:34 -07:00
committed by GitHub
parent 3365fc92fd
commit 6647b32ac0
2 changed files with 17 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ from pathlib import Path
import filelock
from django.conf import settings
from django.test import TestCase
from django.test import override_settings
from documents.models import Document
from documents.sanity_checker import check_sanity
@@ -157,6 +158,17 @@ class TestSanityCheck(DirectoriesMixin, TestCase):
"Orphaned file in media dir",
)
@override_settings(
APP_LOGO="logo/logo.png",
)
def test_ignore_logo(self):
self.make_test_data()
logo_dir = Path(self.dirs.media_dir, "logo")
logo_dir.mkdir(parents=True, exist_ok=True)
Path(self.dirs.media_dir, "logo", "logo.png").touch()
messages = check_sanity()
self.assertFalse(messages.has_warning)
def test_archive_filename_no_checksum(self):
doc = self.make_test_data()
doc.archive_checksum = None