Exemplo n.º 1
0
 def test_2013_jan_1_correct(self):
     dt = utc_datetime(
         year=2013,
         month=1,
         day=1,
         hour=0,
         minute=0)
     self.assertEquals(
         adapter.mk_js_timestamp(dt),
         "2013-01-01T01:00:00+00:00")
Exemplo n.º 2
0
 def test_2013_jun_1_correct(self):
     # summer 2013 IS summertime (+2 hours).
     dt = utc_datetime(
         year=2013,
         month=6,
         day=1,
         hour=0,
         minute=0)
     self.assertEquals(
         adapter.mk_js_timestamp(dt),
         "2013-06-01T02:00:00+00:00")
Exemplo n.º 3
0
    def test_june_1_returns_correctly(self):
        # This turns out to be a trick question -- in 1970 we didn't
        # have summertime yet!
        dt = utc_datetime(
            year=1970,
            month=6,
            day=1,
            hour=0,
            minute=0)

        self.assertEquals(
            adapter.mk_js_timestamp(dt),
            "1970-06-01T01:00:00+00:00")
Exemplo n.º 4
0
    def test_epoch_datetime_returns_3600(self):
        dt = utc_datetime(
            year=1970,
            month=1,
            day=1,
            hour=0,
            minute=0)
        print dt

        # This is the start of the epoch. This time of the year,
        # Europe/Amsterdam is 1 hour ahead of UTC, so the function
        # should return "1970-01-01T01:00+00:00"
        self.assertEquals(
            adapter.mk_js_timestamp(dt),
            "1970-01-01T01:00:00+00:00")