Make Django tests use USE_TZ = True to silence Django 5.x deprecation warning

This commit is contained in:
Swen Kooij 2024-07-02 06:33:55 +03:00 committed by Swen Kooij
parent 150f671115
commit 84beade9e0

View File

@ -1,3 +1,4 @@
import django
import dj_database_url
DEBUG = True
@ -51,6 +52,12 @@ MIDDLEWARE = [
'django.contrib.auth.middleware.AuthenticationMiddleware',
]
# See: https://github.com/psycopg/psycopg2/issues/1293
if django.VERSION >= (3, 1):
USE_TZ = True
USE_I18N = True
TIME_ZONE = 'UTC'
# set to a lower number than the default, since
# we want the tests to be fast, default is 100
LOCALIZED_FIELDS_MAX_RETRIES = 3