Refactor endpoint tests

Replace force_login calls with login call from client class in setUp
This commit is contained in:
sonny 2020-05-24 13:32:12 +02:00
parent a85fe2c02f
commit 3cbf50d0b0
8 changed files with 131 additions and 20 deletions

View file

@ -15,9 +15,9 @@ def build_publication_date(dt, tz):
naive_datetime = datetime(*dt[:6])
published_parsed = timezone.make_aware(naive_datetime, timezone=tz)
except (TypeError, ValueError):
return None, False
return timezone.now()
return published_parsed.astimezone(pytz.utc), True
return published_parsed.astimezone(pytz.utc)
def fetch(url):