Revert "fix and improve test"

This reverts commit 874a11e982.
This commit is contained in:
Richard Schreiber
2026-08-05 12:27:25 +02:00
parent 874a11e982
commit 56f262446a
2 changed files with 7 additions and 8 deletions
+1 -1
View File
@@ -243,7 +243,7 @@ class BaseSenderView(EventPermissionRequiredMixin, FormView):
class OrderSendView(BaseSenderView):
form_class = forms.OrderMailForm
form_fragment_name = "pretixplugins/sendmail/send_form_fragment_orders.html"
context_parameters = ['event', 'order', 'position_or_address', 'event_or_subevent']
context_parameters = ['event', 'order', 'position_or_address']
task = send_mails_to_orders
ACTION_TYPE = 'pretix.plugins.sendmail.sent'
+6 -7
View File
@@ -395,7 +395,7 @@ def test_sendmail_attendee_product_filter(logged_in_client, sendmail_url, event,
'recipients': 'attendees',
'items': i2.pk,
'subject_0': 'Test subject',
'message_0': 'This is a test file for sending mails. {event}, {event_location}, Admission {event_admission_time}',
'message_0': 'This is a test file for sending mails.',
},
follow=True)
assert response.status_code == 200
@@ -404,7 +404,6 @@ def test_sendmail_attendee_product_filter(logged_in_client, sendmail_url, event,
assert djmail.outbox[0].to == ['attendee2@dummy.test']
assert '/ticket/' in djmail.outbox[0].body
assert '/order/' not in djmail.outbox[0].body
assert 'This is a test file for sending mails. Dummy, Foo City, Admission 12:30' in djmail.outbox[0].body
@pytest.mark.django_db
@@ -413,8 +412,8 @@ def test_sendmail_attendee_subevent_filter(logged_in_client, sendmail_url, event
event.has_subevents = True
event.save()
with scopes_disabled():
se1 = event.subevents.create(name='Subevent FOO', date_from=now(), location='FOO Town', date_admission=now().replace(hour=15))
se2 = event.subevents.create(name='Bar', date_from=now(), location='Bar City')
se1 = event.subevents.create(name='Subevent FOO', date_from=now())
se2 = event.subevents.create(name='Bar', date_from=now())
pos.attendee_email = 'attendee1@dummy.test'
pos.subevent = se1
pos.save()
@@ -430,7 +429,7 @@ def test_sendmail_attendee_subevent_filter(logged_in_client, sendmail_url, event
'recipients': 'attendees',
'items': item.pk,
'subject_0': 'Test subject',
'message_0': 'This is a test file for sending mails. {event}, {event_location}, Admission {event_admission_time}',
'message_0': 'This is a test file for sending mails.',
'subevent': se2.pk,
},
follow=True)
@@ -440,7 +439,6 @@ def test_sendmail_attendee_subevent_filter(logged_in_client, sendmail_url, event
assert djmail.outbox[0].to == ['attendee2@dummy.test']
assert '/ticket/' in djmail.outbox[0].body
assert '/order/' not in djmail.outbox[0].body
assert 'This is a test file for sending mails. Subevent FOO, FOO Town, 15:00' in djmail.outbox[0].body
@pytest.mark.django_db
@@ -466,7 +464,7 @@ def test_sendmail_attendee_subevent_range_filter(logged_in_client, sendmail_url,
'recipients': 'attendees',
'items': item.pk,
'subject_0': 'Test subject',
'message_0': 'This is a test file for sending mails.',
'message_0': 'This is a test file for sending mails. {event}, {event_location}, Admission {event_admission_time}',
'subevents_from_0': '2023-07-01',
'subevents_from_1': '00:00:00',
'subevents_to_0': '2023-08-01',
@@ -479,6 +477,7 @@ def test_sendmail_attendee_subevent_range_filter(logged_in_client, sendmail_url,
assert djmail.outbox[0].to == ['attendee1@dummy.test']
assert '/ticket/' in djmail.outbox[0].body
assert '/order/' not in djmail.outbox[0].body
assert 'This is a test file for sending mails. ' in djmail.outbox[0].body
@pytest.mark.django_db