예제 #1
0
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
예제 #2
0
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
예제 #3
0
    def local_run_time(self, obj):
        if obj.next_run_time:
            return util.get_local_dt_format(obj.next_run_time)

        return "(paused)"
예제 #4
0
 def local_run_time(self, obj):
     return util.get_local_dt_format(obj.run_time)