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
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
def run_time_sec(self, obj): return util.localize(obj.run_time)
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)
def next_run_time_sec(self, obj): return util.localize(obj.next_run_time)