Skip to content

Commit

Permalink
Fixed test.
Browse files Browse the repository at this point in the history
  • Loading branch information
facundobatista committed Jan 25, 2024
1 parent 87ae71d commit 4084b0e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions joboffers/tests/test_notify-pending_moderation_offers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@
from joboffers.constants import PENDING_MODERATION_OFFER_DAYS, TELEGRAM_PENDING_MODERATION_MESSAGE
from joboffers.models import JobOffer, OfferState
from joboffers.management.commands.notify_pending_moderation_offers import (
notify_pending_moderation_offers
notify_pending_moderation_offers
)
from .factories import JobOfferFactory
from .fixtures import create_telegram_dummy # noqa


@pytest.mark.django_db
def test_remind_offers_in_moderation(telegram_dummy):
"""
Test expiration of old joboffers command
"""
"""Expiration of old joboffers command."""
today = timezone.now()
two_hundred_days_ago = today - timedelta(days=200)
JobOfferFactory.create()
Expand All @@ -35,6 +33,6 @@ def test_remind_offers_in_moderation(telegram_dummy):
assert offers_notified == 1
assert len(telegram_history) == 1
assert sent_message.endswith(TELEGRAM_PENDING_MODERATION_MESSAGE.format(
offer_url=offer2.get_absolute_url(),
moderation_reminder_days=PENDING_MODERATION_OFFER_DAYS
offer_url=offer2.get_full_url(),
moderation_reminder_days=PENDING_MODERATION_OFFER_DAYS
))

0 comments on commit 4084b0e

Please sign in to comment.