def test_set_local_with_localtime(self): dt = RichDateTime(2000, 12, 31, 4, 56, 7, 890, tzinfo=tzlocal()) self.assertEqual(dt.to_local(), datetime(2000, 12, 31, 4, 56, 7, 890, tzlocal()))
def test_set_local_with_specified_timezone(self): dt = RichDateTime(2000, 12, 31, 4, 56, 7, 890, tzinfo=self.pst) offset = self.pst.utcoffset(datetime(2000, 12, 31, 4, 56, 7, 890, tzinfo=self.pst)) self.assertEqual(dt.to_local(), datetime(2000, 12, 31, 4, 56, 7, 890, tzlocal()) - offset - self.local_to_utc)
def test_set_local_with_utc(self): dt = RichDateTime(2000, 12, 31, 4, 56, 7, 890, tzinfo=self.utc) self.assertEqual(dt.to_local(), datetime(2000, 12, 31, 4, 56, 7, 890, tzlocal()) - self.local_to_utc)