Fix deprecation warnings from Arrow

This commit is contained in:
Joakim Soderlund 2021-01-08 20:03:11 +01:00
parent ea8dcbca7d
commit 9cc8ebb01b
2 changed files with 9 additions and 9 deletions

View file

@ -50,7 +50,7 @@ class DateNormalizer(JayWalker):
"""
parsed = arrow.get(value or 0)
if parsed.timestamp == 0:
if parsed.int_timestamp == 0:
return None
return parsed.to('utc').isoformat()

View file

@ -138,7 +138,7 @@ class TestStoryDateMapper:
story = story.merge(meta=meta)
assert mapper(story).timestamp == 5
assert mapper(story).int_timestamp == 5
def test_meta_with_none_chapters(self, mapper, story):
"""
@ -151,7 +151,7 @@ class TestStoryDateMapper:
story = story.merge(meta=meta)
assert mapper(story).timestamp == 5
assert mapper(story).int_timestamp == 5
def test_meta_with_empty_chapters(self, mapper, story):
"""
@ -164,7 +164,7 @@ class TestStoryDateMapper:
story = story.merge(meta=meta)
assert mapper(story).timestamp == 5
assert mapper(story).int_timestamp == 5
def test_meta_with_only_chapter_dates(self, mapper, story):
"""
@ -180,7 +180,7 @@ class TestStoryDateMapper:
story = story.merge(meta=meta)
assert mapper(story).timestamp == 5
assert mapper(story).int_timestamp == 5
def test_meta_with_only_story_date(self, mapper, story):
"""
@ -197,7 +197,7 @@ class TestStoryDateMapper:
story = story.merge(meta=meta)
assert mapper(story).timestamp == 5
assert mapper(story).int_timestamp == 5
def test_meta_with_latest_chapter_date(self, mapper, story):
"""
@ -214,7 +214,7 @@ class TestStoryDateMapper:
story = story.merge(meta=meta)
assert mapper(story).timestamp == 5
assert mapper(story).int_timestamp == 5
def test_meta_with_latest_story_date(self, mapper, story):
"""
@ -231,7 +231,7 @@ class TestStoryDateMapper:
story = story.merge(meta=meta)
assert mapper(story).timestamp == 5
assert mapper(story).int_timestamp == 5
def test_meta_with_both_latest(self, mapper, story):
"""
@ -248,7 +248,7 @@ class TestStoryDateMapper:
story = story.merge(meta=meta)
assert mapper(story).timestamp == 5
assert mapper(story).int_timestamp == 5
class TestStoryPathMapper: