Example #1
0
 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())
     )
Example #2
0
 def test_to_local_fallback(self):
     assert timezone.to_local_fallback(
         make_aware(datetime.utcnow(), timezone.utc))
     assert timezone.to_local_fallback(datetime.utcnow())
Example #3
0
 def test_to_local_fallback(self):
     assert timezone.to_local_fallback(
         make_aware(datetime.utcnow(), timezone.utc))
     assert timezone.to_local_fallback(datetime.utcnow())
Example #4
0
 def to_local(self, dt):
     if not self.utc_enabled:
         return timezone.to_local_fallback(dt)
     return dt