def test_get_local_dt_format_naive(use_hour_format): dt = datetime.utcnow() dt_hour = dt.strftime("%H") localized_dt_hour = util.get_local_dt_format(dt) assert localized_dt_hour == dt_hour
def test_get_local_dt_format_aware(use_tz): utc_dt = timezone.now() local_dt = timezone.localtime(utc_dt) local_dt_hour = local_dt.strftime("%H") localized_dt_hour = util.get_local_dt_format(utc_dt) assert localized_dt_hour == local_dt_hour
def local_run_time(self, obj): if obj.next_run_time: return util.get_local_dt_format(obj.next_run_time) return "(paused)"
def local_run_time(self, obj): return util.get_local_dt_format(obj.run_time)