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