Tests for fedireads connector

This commit is contained in:
Mouse Reeve
2020-05-10 14:53:45 -07:00
parent d5f46a1c6f
commit 7493abeb53
8 changed files with 1179 additions and 2 deletions

View File

@ -284,8 +284,14 @@ def get_date(date_string):
''' helper function to try to interpret dates '''
if not date_string:
return None
try:
return pytz.utc.localize(parser.parse(date_string))
except ValueError:
pass
try:
return parser.parse(date_string)
except ValueError:
return None