mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-06-07 22:29:45 +00:00
ruff: enable DTZ (flake8-datetimez)
Fixes 44 violations — naive datetime usage replaced with tz-aware equivalents throughout production and test code: - datetime.now() → timezone.now() (Django) or datetime.now(tz=UTC) - datetime.fromtimestamp() → datetime.fromtimestamp(ts, tz=UTC) - datetime.date.today() → timezone.now().date() - datetime.datetime(...) constructors → tzinfo=UTC in tests - UP017 auto-converted datetime.timezone.utc → datetime.UTC (py3.11+) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -265,7 +265,7 @@ class TestDocumentApi(DirectoriesMixin, ConsumeTaskMixin, APITestCase):
|
||||
created=date(2023, 1, 1),
|
||||
)
|
||||
|
||||
created_datetime = datetime.datetime(2023, 2, 1, 12, 0, 0)
|
||||
created_datetime = datetime.datetime(2023, 2, 1, 12, 0, 0, tzinfo=datetime.UTC)
|
||||
response = self.client.patch(
|
||||
f"/api/documents/{doc.pk}/",
|
||||
{"created": created_datetime},
|
||||
|
||||
Reference in New Issue
Block a user