From 2f426fe5f7e3bcc6eb55722df1350f63a17f945c Mon Sep 17 00:00:00 2001 From: codl Date: Sat, 9 Sep 2017 00:21:46 +0200 Subject: [PATCH] fix: no need to parse date ourself, mastodon.py v1.1.0 does it --- lib/mastodon.py | 2 +- test/test_libbrotli.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/mastodon.py b/lib/mastodon.py index 9a0af19..3889e73 100644 --- a/lib/mastodon.py +++ b/lib/mastodon.py @@ -150,7 +150,7 @@ def post_from_api_object(obj, instance): favourite=obj['favourited'], has_media=('media_attachments' in obj and bool(obj['media_attachments'])), - created_at=iso8601.parse_date(obj['created_at']), + created_at=obj['created_at'], author_id=account_from_api_object(obj['account'], instance).id, direct=obj['visibility'] == 'direct', ) diff --git a/test/test_libbrotli.py b/test/test_libbrotli.py index a87308f..4365f49 100644 --- a/test/test_libbrotli.py +++ b/test/test_libbrotli.py @@ -13,9 +13,10 @@ def app(redisdb): app_.config['REDIS_URI'] = 'redis://localhost:15487' app_.debug = True - @app_.route('/') - def hello(): - return 'Hello, world!' + @app_.route('/', defaults={'name': 'world'}) + @app_.route('/') + def hello(name='world'): + return 'Hello, {name}!'.format(name=name) with app_.app_context(): yield app_