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)
Beispiel #2
0
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
Beispiel #3
0
    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)
Beispiel #4
0
def test_setup_timezone_unknown():
    with pytest.raises(ValueError):
        setup_timezone("Unknown/Timezone")
Beispiel #5
0
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)
Beispiel #8
0
 def setUp(self):
     setup_locale('en_US.UTF-8')
     setup_timezone('UTC')
Beispiel #9
0
 def test_setup_timezone_empty(self):
     previous = datetime.datetime.now()
     setup_timezone(None)
     self.assertEqual(previous.hour, datetime.datetime.now().hour)