def test_to_utc_not_daylight_savings_time(self): a = Airport(iata_code=self.iata_code) local_datetime_no_dst = self.loc_time_not_dst_naive utc_time_no_dst = a.to_utc(local_datetime_no_dst) self.assertEqual( local_datetime_no_dst, utc_time_no_dst.replace(tzinfo=None) - timedelta(days=0, seconds=60 * 60 * 8))
def test_from_utc(self): a = Airport(iata_code=self.iata_code) utc_time = a.to_utc(self.loc_time_dst_naive) self.assertEqual( a.from_utc(utc_time).replace(tzinfo=None), self.loc_time_dst_naive)