mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-12-03 17:58:41 +00:00
Fix: fix failing timezone tests
This commit is contained in:
1 file changed
+8
-4
@@ -671,8 +671,8 @@ class TestDocumentSearchApi(DirectoriesMixin, APITestCase):
|
||||
content="things i paid for in august",
|
||||
pk=2,
|
||||
checksum="B",
|
||||
# 1 month, 1 day ago
|
||||
added=timezone.now() - relativedelta(months=1, days=1),
|
||||
# More than 1 month ago, in the search timezone
|
||||
added=timezone.localtime() - relativedelta(months=1, days=7),
|
||||
)
|
||||
d3 = Document.objects.create(
|
||||
title="bank statement 3",
|
||||
@@ -706,6 +706,10 @@ class TestDocumentSearchApi(DirectoriesMixin, APITestCase):
|
||||
@override_settings(
|
||||
TIME_ZONE="America/Denver",
|
||||
)
|
||||
@time_machine.travel(
|
||||
datetime.datetime(2026, 12, 1, 0, 1, tzinfo=datetime.UTC),
|
||||
tick=False,
|
||||
)
|
||||
def test_search_added_in_last_month_timezone_behind(self) -> None:
|
||||
"""
|
||||
GIVEN:
|
||||
@@ -729,8 +733,8 @@ class TestDocumentSearchApi(DirectoriesMixin, APITestCase):
|
||||
content="things i paid for in august",
|
||||
pk=2,
|
||||
checksum="B",
|
||||
# 1 month, 1 day ago
|
||||
added=timezone.now() - relativedelta(months=1, days=1),
|
||||
# More than 1 month ago, in the search timezone
|
||||
added=timezone.localtime() - relativedelta(months=1, days=7),
|
||||
)
|
||||
d3 = Document.objects.create(
|
||||
title="bank statement 3",
|
||||
|
||||
Reference in new issue
Block a user