def humanize_arrow_date(date): """ Date is internal UTC ISO format string. Output should be "today", "yesterday", "in 5 days", etc. Arrow will try to humanize down to the minute, so we need to catch 'today' as a special case. """ return memo_func.humanize_date(date)
def test_today(): todaydate = servertime.isoformat().split('T')[0] assert humanize_date(todaydate) == "Today"
def test_in2days(): intwo = servertime.shift(days=+2).isoformat().split('T')[0] assert humanize_date(intwo) == "in 2 days"
def test_1dayago(): oneago = servertime.shift(days=-1).isoformat().split('T')[0] assert humanize_date(oneago) == "a day ago"
def test_tomorrow(): tmrdate = servertime.shift(days=+1).isoformat().split('T')[0] assert humanize_date(tmrdate) == "Tomorrow"