<s> import copy <EOL> import datetime <EOL> import os <EOL> import pickle <EOL> import time <EOL> from django . utils . tzinfo import FixedOffset , LocalTimezone <EOL> from django . utils import unittest <EOL> class TzinfoTests ( unittest . TestCase ) : <EOL> @ classmethod <EOL> def setUpClass ( cls ) : <EOL> cls . old_TZ = os . environ . get ( '<STR_LIT>' ) <EOL> os . environ [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> try : <EOL> time . tzset ( ) <EOL> cls . tz_tests = True <EOL> except AttributeError : <EOL> cls . tz_tests = False <EOL> @ classmethod <EOL> def tearDownClass ( cls ) : <EOL> if cls . old_TZ is None : <EOL> del os . environ [ '<STR_LIT>' ] <EOL> else : <EOL> os . environ [ '<STR_LIT>' ] = cls . old_TZ <EOL> if cls . tz_tests : <EOL> time . tzset ( ) <EOL> def test_fixedoffset ( self ) : <EOL> self . assertEqual ( repr ( FixedOffset ( <NUM_LIT:0> ) ) , '<STR_LIT>' ) <EOL> self . assertEqual ( repr ( FixedOffset ( <NUM_LIT> ) ) , '<STR_LIT>' ) <EOL> self . assertEqual ( repr ( FixedOffset ( - <NUM_LIT> ) ) , '<STR_LIT>' ) <EOL> self . assertEqual ( repr ( FixedOffset ( <NUM_LIT> ) ) , '<STR_LIT>' ) <EOL> self . assertEqual ( repr ( FixedOffset ( - <NUM_LIT> ) ) , '<STR_LIT>' ) <EOL> self . assertEqual ( repr ( FixedOffset ( - <NUM_LIT> ) ) , '<STR_LIT>' ) <EOL> self . assertEqual ( repr ( FixedOffset ( <NUM_LIT> ) ) , '<STR_LIT>' ) <EOL> self . assertEqual ( repr ( FixedOffset ( - <NUM_LIT> * <NUM_LIT> ) ) , '<STR_LIT>' ) <EOL> self . assertEqual ( repr ( FixedOffset ( <NUM_LIT> * <NUM_LIT> ) ) , '<STR_LIT>' ) <EOL> self . assertEqual ( repr ( FixedOffset ( - <NUM_LIT> * <NUM_LIT> ) ) , '<STR_LIT>' ) <EOL> self . assertEqual ( repr ( FixedOffset ( <NUM_LIT> * <NUM_LIT> ) ) , '<STR_LIT>' ) <EOL> def test_16899 ( self ) : <EOL> if not self . tz_tests : <EOL> return <EOL> ts = <NUM_LIT> <EOL> dt = datetime . datetime . utcfromtimestamp ( ts ) <EOL> tz = LocalTimezone ( dt + datetime . timedelta ( days = <NUM_LIT:1> ) ) <EOL> self . assertEqual ( <EOL> repr ( datetime . datetime . fromtimestamp ( ts - <NUM_LIT> , tz ) ) , <EOL> '<STR_LIT>' ) <EOL> self . assertEqual ( <EOL> repr ( datetime . datetime . fromtimestamp ( ts , tz ) ) , <EOL> '<STR_LIT>' ) <EOL> self . assertEqual ( <EOL> repr ( datetime . datetime . fromtimestamp ( ts + <NUM_LIT> , tz ) ) , <EOL> '<STR_LIT>' ) <EOL> def test_copy ( self ) : <EOL> now = datetime . datetime . now ( ) <EOL> self . assertIsInstance ( copy . copy ( FixedOffset ( <NUM_LIT> ) ) , FixedOffset ) <EOL> self . assertIsInstance ( copy . copy ( LocalTimezone ( now ) ) , LocalTimezone ) <EOL> def test_deepcopy ( self ) : <EOL> now = datetime . datetime . now ( ) <EOL> self . assertIsInstance ( copy . deepcopy ( FixedOffset ( <NUM_LIT> ) ) , FixedOffset ) <EOL> self . assertIsInstance ( copy . deepcopy ( LocalTimezone ( now ) ) , LocalTimezone ) <EOL> def test_pickling_unpickling ( self ) : <EOL> now = datetime . datetime . now ( ) <EOL> self . assertIsInstance ( pickle . loads ( pickle . dumps ( FixedOffset ( <NUM_LIT> ) ) ) , FixedOffset ) <EOL> self . assertIsInstance ( pickle . loads ( pickle . dumps ( LocalTimezone ( now ) ) ) , LocalTimezone ) </s>
