From 84beade9e06675aac83fd8a97b56e176089e77a2 Mon Sep 17 00:00:00 2001 From: Swen Kooij Date: Tue, 2 Jul 2024 06:33:55 +0300 Subject: [PATCH] Make Django tests use `USE_TZ = True` to silence Django 5.x deprecation warning --- settings.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/settings.py b/settings.py index b4680b8..42be8fe 100644 --- a/settings.py +++ b/settings.py @@ -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