diff --git a/plinth/tests/data/django_test_settings.py b/plinth/tests/data/django_test_settings.py index 1cc2f15a3..0f742f4e3 100644 --- a/plinth/tests/data/django_test_settings.py +++ b/plinth/tests/data/django_test_settings.py @@ -56,3 +56,7 @@ TEMPLATES = [{ 'APP_DIRS': True, 'DIRS': ['plinth/tests/data/templates/'], }] + +TIME_ZONE = 'UTC' + +USE_TZ = True diff --git a/plinth/tests/test_notification.py b/plinth/tests/test_notification.py index 6af90bc7f..cd72755c0 100644 --- a/plinth/tests/test_notification.py +++ b/plinth/tests/test_notification.py @@ -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'