Skip to content

Commit 84beade

Browse files
committed
Make Django tests use USE_TZ = True to silence Django 5.x deprecation warning
1 parent 150f671 commit 84beade

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

settings.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import django
12
import dj_database_url
23

34
DEBUG = True
@@ -51,6 +52,12 @@
5152
'django.contrib.auth.middleware.AuthenticationMiddleware',
5253
]
5354

55+
# See: https://github.com/psycopg/psycopg2/issues/1293
56+
if django.VERSION >= (3, 1):
57+
USE_TZ = True
58+
USE_I18N = True
59+
TIME_ZONE = 'UTC'
60+
5461
# set to a lower number than the default, since
5562
# we want the tests to be fast, default is 100
5663
LOCALIZED_FIELDS_MAX_RETRIES = 3

0 commit comments

Comments
 (0)