Exemple #1
0
def test_localize_naive(use_hour_format):

    dt = datetime.utcnow()
    dt_hour = dt.strftime("%H")

    localized_dt_hour = util.localize(dt)

    assert localized_dt_hour == dt_hour
Exemple #2
0
def test_localize_aware(use_tz):
    utc_dt = timezone.now()

    local_dt = timezone.localtime(utc_dt)
    local_dt_hour = local_dt.strftime("%H")

    localized_dt_hour = util.localize(utc_dt)

    assert localized_dt_hour == local_dt_hour
Exemple #3
0
 def run_time_sec(self, obj):
     return util.localize(obj.run_time)
Exemple #4
0
 def next_run_time_sec(self, obj):
     if obj.next_run_time is None:
         return "(paused)"
     return util.localize(obj.next_run_time)
 def __str__(self):
     status = 'next run at: %s' % util.localize(
         self.next_run_time) if self.next_run_time else 'paused'
     return '%s (%s)' % (self.name, status)
Exemple #6
0
 def next_run_time_sec(self, obj):
     return util.localize(obj.next_run_time)