A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
add test for filename expectation with modified timezone
Oliver Lippert0ba1ba55bd99
diff --git a/src/documents/tests/test_document_model.py b/src/documents/tests/test_document_model.pyindex a99d6dd18..bea8b6b91 100644--- a/src/documents/tests/test_document_model.py+++ b/src/documents/tests/test_document_model.py@@ -3,6 +3,7 @@ import tempfilefrom pathlib import Pathfrom unittest import mock+import pytzfrom django.test import override_settingsfrom django.test import TestCasefrom django.utils import timezone@@ -55,6 +56,24 @@ class TestDocument(TestCase):)self.assertEqual(doc.get_public_filename(), "2020-12-25 test.pdf")+ def test_file_name_with_timezone(self):++ doc = Document(+ mime_type="application/pdf",+ title="test",+ created=timezone.datetime(+ 2020,+ 12,+ 25,+ 0,+ 0,+ 0,+ 0,+ pytz.timezone("Europe/Berlin"),+ ),+ )+ self.assertEqual(doc.get_public_filename(), "2020-12-25 test.pdf")+def test_file_name_jpg(self):doc = Document(