def test_setup_timezone(self): setup_timezone('UTC') utc_now = datetime.datetime.now() setup_timezone('Europe/Kiev') kyiv_now = datetime.datetime.now() self.assertNotEqual(utc_now.hour, kyiv_now.hour)
def test_setup_timezone(): setup_timezone("UTC") utc_now = datetime.datetime.now() setup_timezone("Europe/Kiev") kyiv_now = datetime.datetime.now() assert utc_now.hour != kyiv_now.hour
def test_setup_timezone_unknown(): with pytest.raises(ValueError): setup_timezone("Unknown/Timezone")
def test_setup_timezone_empty(): previous = datetime.datetime.now() setup_timezone(None) assert previous.hour == datetime.datetime.now().hour
def setUp(self): setup_locale('en_US.UTF-8') setup_timezone('UTC')
def test_setup_timezone_empty(self): previous = datetime.datetime.now() setup_timezone(None) self.assertEqual(previous.hour, datetime.datetime.now().hour)