mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
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:
parent
f8e78f33d3
commit
70ed89eff9
@ -56,3 +56,7 @@ TEMPLATES = [{
|
|||||||
'APP_DIRS': True,
|
'APP_DIRS': True,
|
||||||
'DIRS': ['plinth/tests/data/templates/'],
|
'DIRS': ['plinth/tests/data/templates/'],
|
||||||
}]
|
}]
|
||||||
|
|
||||||
|
TIME_ZONE = 'UTC'
|
||||||
|
|
||||||
|
USE_TZ = True
|
||||||
|
|||||||
@ -386,7 +386,7 @@ def test_display_context(gettext, note, user, rf):
|
|||||||
assert context_note['actions'] == expected_actions
|
assert context_note['actions'] == expected_actions
|
||||||
assert context_note['data'] == expected_data
|
assert context_note['data'] == expected_data
|
||||||
assert note.data == 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['created_time']).seconds < 60
|
||||||
assert (now - context_note['last_update_time']).seconds < 60
|
assert (now - context_note['last_update_time']).seconds < 60
|
||||||
assert context_note['user'] == 'test-user'
|
assert context_note['user'] == 'test-user'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user