TinCanPython
TinCanPython copied to clipboard
iso8601 bug
Hi,
someone copied your conversion from datetime.timedelta to iso8601 to Stack Overflow, and I spotted a bug in it. If you add these two tests they will fail:
iso = jsonify_timedelta(timedelta(seconds=10)) self.assertEqual(iso, 'PT10S') #will return PT1S iso = jsonify_timedelta(timedelta(seconds=60)) self.assertEqual(iso, 'PT01M') #will return PT1MS