From a0a2c5cb370ff80a95deaa8d23f099acc4e5e0c5 Mon Sep 17 00:00:00 2001 From: Terence Honles Date: Fri, 16 Apr 2021 09:27:22 -0700 Subject: [PATCH] Fix tests with mock timezone (#7911) After django/django#13877, Django no longer checks for `hasattr(timezone, 'localize')` and instead does an inheritance check. --- tests/test_fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_fields.py b/tests/test_fields.py index 5842553f0..78a9effb8 100644 --- a/tests/test_fields.py +++ b/tests/test_fields.py @@ -1485,7 +1485,7 @@ class TestNaiveDayLightSavingTimeTimeZoneDateTimeField(FieldValues): } outputs = {} - class MockTimezone: + class MockTimezone(pytz.BaseTzInfo): @staticmethod def localize(value, is_dst): raise pytz.InvalidTimeError()