mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #17262 -- Refactored tzinfo implementations.
This commit deprecates django.utils.tzinfo in favor of the more recent django.utils.timezone which was introduced when Django gained support for time zones.
This commit is contained in:
@@ -4,10 +4,16 @@ import os
|
||||
import pickle
|
||||
import time
|
||||
import unittest
|
||||
import warnings
|
||||
|
||||
from django.utils.tzinfo import FixedOffset, LocalTimezone
|
||||
from django.test.utils import IgnorePendingDeprecationWarningsMixin
|
||||
|
||||
class TzinfoTests(unittest.TestCase):
|
||||
# Swallow the import-time warning to test the deprecated implementation.
|
||||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings("ignore", category=PendingDeprecationWarning)
|
||||
from django.utils.tzinfo import FixedOffset, LocalTimezone
|
||||
|
||||
class TzinfoTests(IgnorePendingDeprecationWarningsMixin, unittest.TestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
|
||||
Reference in New Issue
Block a user