Do not send download reminders if order is placed after download date

This commit is contained in:
Raphael Michel
2020-01-07 11:52:11 +01:00
parent 8e2821b398
commit fdd45a85f0
2 changed files with 10 additions and 2 deletions

View File

@@ -434,7 +434,7 @@ class DownloadReminderTests(TestCase):
self.order = Order.objects.create(
code='FOO', event=self.event, email='dummy@dummy.test',
status=Order.STATUS_PAID, locale='en',
datetime=now() - timedelta(hours=4),
datetime=now() - timedelta(days=4),
expires=now() - timedelta(hours=4) + timedelta(days=10),
total=Decimal('46.00'),
)
@@ -533,6 +533,14 @@ class DownloadReminderTests(TestCase):
send_download_reminders(sender=self.event)
assert len(djmail.outbox) == 0
@classscope(attr='o')
def test_not_sent_after_reminder_date(self):
self.order.datetime = self.event.date_from - timedelta(days=1)
self.order.save()
self.event.settings.mail_days_download_reminder = 2
send_download_reminders(sender=self.event)
assert len(djmail.outbox) == 0
class OrderCancelTests(TestCase):
def setUp(self):