mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-05-03 11:29:28 -05:00
add test for filename expectation with modified timezone
Signed-off-by: Oliver Lippert <info@trusty.codes> #267
This commit is contained in:
parent
81582bb2e7
commit
67c85effaa
@ -3,6 +3,7 @@ import tempfile
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from unittest import mock
|
from unittest import mock
|
||||||
|
|
||||||
|
import pytz
|
||||||
from django.test import override_settings
|
from django.test import override_settings
|
||||||
from django.test import TestCase
|
from django.test import TestCase
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
@ -55,6 +56,24 @@ class TestDocument(TestCase):
|
|||||||
)
|
)
|
||||||
self.assertEqual(doc.get_public_filename(), "2020-12-25 test.pdf")
|
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):
|
def test_file_name_jpg(self):
|
||||||
|
|
||||||
doc = Document(
|
doc = Document(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user