tests: django: Fix a warning related timezone settings

The warning is:

RemovedInDjango50Warning: The default value of USE_TZ will change from False to
True in Django 5.0. Set USE_TZ to False in your project settings if you want to
keep the current default behavior.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2025-03-28 21:26:43 -04:00
1 parent f8e78f33d3
commit 70ed89eff9
2 files changed
+5 -1

No files matched your search

@@ -56,3 +56,7 @@ TEMPLATES = [{
'APP_DIRS': True,
'DIRS': ['plinth/tests/data/templates/'],
}]
TIME_ZONE = 'UTC'
USE_TZ = True
+1 -1
View File
@@ -386,7 +386,7 @@ def test_display_context(gettext, note, user, rf):
assert context_note['actions'] == expected_actions
assert context_note['data'] == expected_data
assert note.data == data
now = datetime.datetime.now()
now = datetime.datetime.now(datetime.timezone.utc)
assert (now - context_note['created_time']).seconds < 60
assert (now - context_note['last_update_time']).seconds < 60
assert context_note['user'] == 'test-user'