def _format_time_ago(time): build_time = parser.parse(time) if build_time.tzinfo: build_time = build_time.astimezone(pytz.utc).replace(tzinfo=None) delta = datetime.utcnow() - build_time return timeago(delta)
def test_timeago(delta, expected): assert_equals(timeago(delta), expected)