def _escape_timedelta(dt, c): return times.DateTimeDelta2literal(dt, c).decode('utf-8')
def test_datetimedelta_to_literal(self): d = datetime(2015, 12, 13, 1, 2, 3) - datetime(2015, 12, 13, 1, 2, 2) assert times.DateTimeDelta2literal(d, '') == b"'0 0:0:1'"