Only send download reminders if there's actually a download

This commit is contained in:
Raphael Michel
2020-03-16 09:22:41 +01:00
parent 9a32668ee1
commit 8d23d75dfd
3 changed files with 36 additions and 2 deletions

View File

@@ -445,8 +445,24 @@ class DownloadReminderTests(TestCase):
order=self.order, item=self.ticket, variation=None,
price=Decimal("23.00"), attendee_name_parts={"full_name": "Peter"}, positionid=1
)
self.event.settings.ticket_download = True
djmail.outbox = []
@classscope(attr='o')
def test_downloads_disabled(self):
self.event.settings.mail_days_download_reminder = 2
self.event.settings.ticket_download = False
send_download_reminders(sender=self.event)
assert len(djmail.outbox) == 0
@classscope(attr='o')
def test_downloads_disabled_per_product(self):
self.event.settings.mail_days_download_reminder = 2
self.ticket.generate_tickets = False
self.ticket.save()
send_download_reminders(sender=self.event)
assert len(djmail.outbox) == 0
@classscope(attr='o')
def test_disabled(self):
send_download_reminders(sender=self.event)