Ejemplo n.º 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())
     )
Ejemplo n.º 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())
Ejemplo n.º 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())
Ejemplo n.º 4
0
 def to_local(self, dt):
     if not self.utc_enabled:
         return timezone.to_local_fallback(dt)
     return dt