Refactor endpoint tests
Replace force_login calls with login call from client class in setUp
This commit is contained in:
parent
428cd39d13
commit
6a4f33c182
135 changed files with 4315 additions and 1336 deletions
|
|
@ -2,6 +2,7 @@ from datetime import datetime
|
|||
|
||||
from django.utils import timezone
|
||||
|
||||
import pytz
|
||||
import requests
|
||||
|
||||
from requests.exceptions import RequestException
|
||||
|
|
@ -15,7 +16,8 @@ def build_publication_date(dt, tz):
|
|||
published_parsed = timezone.make_aware(naive_datetime, timezone=tz)
|
||||
except (TypeError, ValueError):
|
||||
return None, False
|
||||
return published_parsed, True
|
||||
|
||||
return published_parsed.astimezone(pytz.utc), True
|
||||
|
||||
|
||||
def fetch(url):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue