Sendmail: Allow to send only to (un)approved

This commit is contained in:
Raphael Michel
2020-11-10 11:37:38 +01:00
parent 2c1195eaa1
commit eae1fc9a81
3 changed files with 29 additions and 18 deletions

View File

@@ -80,7 +80,7 @@ def test_sendmail_view(logged_in_client, sendmail_url, expected=200):
def test_sendmail_simple_case(logged_in_client, sendmail_url, event, order, pos):
djmail.outbox = []
response = logged_in_client.post(sendmail_url,
{'sendto': 'n',
{'sendto': 'na',
'recipients': 'orders',
'items': pos.item_id,
'subject_0': 'Test subject',
@@ -122,7 +122,7 @@ def test_sendmail_email_not_sent_if_order_not_match(logged_in_client, sendmail_u
def test_sendmail_preview(logged_in_client, sendmail_url, event, order, pos):
djmail.outbox = []
response = logged_in_client.post(sendmail_url,
{'sendto': 'n',
{'sendto': 'na',
'recipients': 'orders',
'items': pos.item_id,
'subject_0': 'Test subject',
@@ -140,7 +140,7 @@ def test_sendmail_preview(logged_in_client, sendmail_url, event, order, pos):
def test_sendmail_invalid_data(logged_in_client, sendmail_url, event, order, pos):
djmail.outbox = []
response = logged_in_client.post(sendmail_url,
{'sendto': 'n',
{'sendto': 'na',
'recipients': 'orders',
'items': pos.item_id,
'subject_0': 'Test subject',
@@ -205,7 +205,7 @@ def test_sendmail_subevents(logged_in_client, sendmail_url, event, order, pos):
djmail.outbox = []
response = logged_in_client.post(sendmail_url,
{'sendto': 'n',
{'sendto': 'na',
'recipients': 'orders',
'items': pos.item_id,
'subject_0': 'Test subject',
@@ -219,7 +219,7 @@ def test_sendmail_subevents(logged_in_client, sendmail_url, event, order, pos):
djmail.outbox = []
response = logged_in_client.post(sendmail_url,
{'sendto': 'n',
{'sendto': 'na',
'recipients': 'orders',
'items': pos.item_id,
'subject_0': 'Test subject',
@@ -240,7 +240,7 @@ def test_sendmail_subevents(logged_in_client, sendmail_url, event, order, pos):
def test_sendmail_placeholder(logged_in_client, sendmail_url, event, order, pos):
djmail.outbox = []
response = logged_in_client.post(sendmail_url,
{'sendto': 'n',
{'sendto': 'na',
'recipients': 'orders',
'items': pos.item_id,
'subject_0': '{code} Test subject',
@@ -264,7 +264,7 @@ def test_sendmail_attendee_mails(logged_in_client, sendmail_url, event, order, p
djmail.outbox = []
response = logged_in_client.post(sendmail_url,
{'sendto': 'n',
{'sendto': 'na',
'recipients': 'attendees',
'items': pos.item_id,
'subject_0': 'Test subject',
@@ -288,7 +288,7 @@ def test_sendmail_both_mails(logged_in_client, sendmail_url, event, order, pos):
djmail.outbox = []
response = logged_in_client.post(sendmail_url,
{'sendto': 'n',
{'sendto': 'na',
'recipients': 'both',
'items': pos.item_id,
'subject_0': 'Test subject',
@@ -315,7 +315,7 @@ def test_sendmail_both_but_same_address(logged_in_client, sendmail_url, event, o
djmail.outbox = []
response = logged_in_client.post(sendmail_url,
{'sendto': 'n',
{'sendto': 'na',
'recipients': 'both',
'items': pos.item_id,
'subject_0': 'Test subject',
@@ -339,7 +339,7 @@ def test_sendmail_attendee_fallback(logged_in_client, sendmail_url, event, order
djmail.outbox = []
response = logged_in_client.post(sendmail_url,
{'sendto': 'n',
{'sendto': 'na',
'recipients': 'attendees',
'items': pos.item_id,
'subject_0': 'Test subject',
@@ -368,7 +368,7 @@ def test_sendmail_attendee_product_filter(logged_in_client, sendmail_url, event,
djmail.outbox = []
response = logged_in_client.post(sendmail_url,
{'sendto': 'n',
{'sendto': 'na',
'recipients': 'attendees',
'items': i2.pk,
'subject_0': 'Test subject',
@@ -396,7 +396,7 @@ def test_sendmail_attendee_checkin_filter(logged_in_client, sendmail_url, event,
djmail.outbox = []
response = logged_in_client.post(sendmail_url,
{'sendto': 'n',
{'sendto': 'na',
'recipients': 'attendees',
'items': pos2.item_id,
'filter_checkins': 'on',
@@ -414,7 +414,7 @@ def test_sendmail_attendee_checkin_filter(logged_in_client, sendmail_url, event,
djmail.outbox = []
response = logged_in_client.post(sendmail_url,
{'sendto': 'n',
{'sendto': 'na',
'recipients': 'attendees',
'items': pos2.item_id,
'subject_0': 'Test subject',
@@ -432,7 +432,7 @@ def test_sendmail_attendee_checkin_filter(logged_in_client, sendmail_url, event,
djmail.outbox = []
response = logged_in_client.post(sendmail_url,
{'sendto': 'n',
{'sendto': 'na',
'recipients': 'attendees',
'items': pos2.item_id,
'subject_0': 'Test subject',
@@ -451,7 +451,7 @@ def test_sendmail_attendee_checkin_filter(logged_in_client, sendmail_url, event,
# Test that filtering is ignored if filter_checkins is not set
djmail.outbox = []
response = logged_in_client.post(sendmail_url,
{'sendto': 'n',
{'sendto': 'na',
'recipients': 'attendees',
'items': pos2.item_id,
'subject_0': 'Test subject',
@@ -472,7 +472,7 @@ def test_sendmail_attendee_checkin_filter(logged_in_client, sendmail_url, event,
# Test that filtering is ignored if filter_checkins is not set
djmail.outbox = []
response = logged_in_client.post(sendmail_url,
{'sendto': 'n',
{'sendto': 'na',
'recipients': 'attendees',
'items': pos2.item_id,
'subject_0': 'Test subject',