Beispiel #1
0
 def test_ensure_tz_specified(self):
     """
     If the timezone is specified, the result should be the same.
     """
     dt = datetime.datetime.now(dateutils.local_tz())
     new_date = Repository._ensure_tz_specified(dt)
     self.assertEquals(new_date.tzinfo, dateutils.utc_tz())
Beispiel #2
0
 def test_ensure_tz_none_object(self):
     """
     Test _ensure_tz_specified with None.
     """
     dt = None
     new_date = Repository._ensure_tz_specified(dt)
     self.assertEquals(new_date, None)
Beispiel #3
0
 def test_ensure_tz_not_specified(self):
     """
     Make sure that a date without a timezone is given one.
     """
     dt = datetime.datetime.utcnow()
     new_date = Repository._ensure_tz_specified(dt)
     self.assertEquals(new_date.tzinfo, dateutils.utc_tz())
Beispiel #4
0
 def test_ensure_tz_specified(self):
     """
     If the timezone is specified, the result should be the same.
     """
     dt = datetime.datetime.now(dateutils.local_tz())
     new_date = Repository._ensure_tz_specified(dt)
     self.assertEquals(new_date.tzinfo, dateutils.utc_tz())
Beispiel #5
0
 def test_ensure_tz_none_object(self):
     """
     Test _ensure_tz_specified with None.
     """
     dt = None
     new_date = Repository._ensure_tz_specified(dt)
     self.assertEquals(new_date, None)
Beispiel #6
0
 def test_ensure_tz_not_specified(self):
     """
     Make sure that a date without a timezone is given one.
     """
     dt = datetime.datetime.utcnow()
     new_date = Repository._ensure_tz_specified(dt)
     self.assertEquals(new_date.tzinfo, dateutils.utc_tz())