mirror of
https://github.com/peeringdb/peeringdb.git
synced 2024-05-11 05:55:09 +00:00
fix tests (#869)
This commit is contained in:
@@ -14,7 +14,8 @@ RUN apk --update --no-cache add \
|
|||||||
libjpeg-turbo-dev \
|
libjpeg-turbo-dev \
|
||||||
linux-headers \
|
linux-headers \
|
||||||
make \
|
make \
|
||||||
mariadb-dev
|
mariadb-dev \
|
||||||
|
libffi-dev
|
||||||
|
|
||||||
# create venv
|
# create venv
|
||||||
RUN pip install -U pip pipenv
|
RUN pip install -U pip pipenv
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ class RdapLookup(rdap.RdapClient):
|
|||||||
config = dict(
|
config = dict(
|
||||||
bootstrap_url=settings.RDAP_URL.rstrip("/"),
|
bootstrap_url=settings.RDAP_URL.rstrip("/"),
|
||||||
lacnic_apikey=settings.RDAP_LACNIC_APIKEY,
|
lacnic_apikey=settings.RDAP_LACNIC_APIKEY,
|
||||||
timeout=2.5,
|
timeout=10,
|
||||||
)
|
)
|
||||||
super().__init__(config)
|
super().__init__(config)
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ from peeringdb_server.models import Organization
|
|||||||
|
|
||||||
FIVE_MONTHS_AGO = datetime.now(tz=timezone.utc) - timedelta(days=150)
|
FIVE_MONTHS_AGO = datetime.now(tz=timezone.utc) - timedelta(days=150)
|
||||||
TWO_MONTHS_AGO = datetime.now(tz=timezone.utc) - timedelta(days=60)
|
TWO_MONTHS_AGO = datetime.now(tz=timezone.utc) - timedelta(days=60)
|
||||||
NOW = datetime.now(tz=timezone.utc)
|
|
||||||
# max number of seconds we allow between running command and asserting date is
|
# max number of seconds we allow between running command and asserting date is
|
||||||
# the same
|
# the same
|
||||||
SECONDS_THRESHOLD = 120
|
SECONDS_THRESHOLD = 120
|
||||||
@@ -22,6 +21,7 @@ SECONDS_THRESHOLD = 120
|
|||||||
@pytest.mark.django_db
|
@pytest.mark.django_db
|
||||||
@override_settings(SPONSORSHIPS_EMAIL="localhost")
|
@override_settings(SPONSORSHIPS_EMAIL="localhost")
|
||||||
def test_send_email(outdated_sponsorship):
|
def test_send_email(outdated_sponsorship):
|
||||||
|
NOW = datetime.now(tz=timezone.utc)
|
||||||
sponsorship = Sponsorship.objects.all()[0]
|
sponsorship = Sponsorship.objects.all()[0]
|
||||||
call_command("pdb_sponsorship_notify")
|
call_command("pdb_sponsorship_notify")
|
||||||
sponsorship.refresh_from_db()
|
sponsorship.refresh_from_db()
|
||||||
|
|||||||
Reference in New Issue
Block a user