def test_to_local_fallback(self): self.assertTrue( timezone.to_local_fallback( make_aware(datetime.utcnow(), timezone.utc)), ) self.assertTrue( timezone.to_local_fallback(datetime.utcnow()) )
def test_to_local_fallback(self): assert timezone.to_local_fallback( make_aware(datetime.utcnow(), timezone.utc)) assert timezone.to_local_fallback(datetime.utcnow())
def to_local(self, dt): if not self.utc_enabled: return timezone.to_local_fallback(dt) return dt