1
0
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:
Aymeric Augustin
2013-09-08 02:04:31 -05:00
parent 9d700322b3
commit ec2778b445
8 changed files with 117 additions and 21 deletions

View File

@@ -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):