Fix tests with mock timezone (#7911)

After django/django#13877, Django no longer checks for `hasattr(timezone, 'localize')` and instead does an inheritance check.
This commit is contained in:
Terence Honles 2021-04-16 09:27:22 -07:00 committed by GitHub
parent f628db383a
commit a0a2c5cb37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1485,7 +1485,7 @@ class TestNaiveDayLightSavingTimeTimeZoneDateTimeField(FieldValues):
}
outputs = {}
class MockTimezone:
class MockTimezone(pytz.BaseTzInfo):
@staticmethod
def localize(value, is_dst):
raise pytz.InvalidTimeError()