From 56f262446a3e5000f1dd21b09f0b86c0a63d767f Mon Sep 17 00:00:00 2001 From: Richard Schreiber Date: Wed, 5 Aug 2026 12:27:25 +0200 Subject: [PATCH] Revert "fix and improve test" This reverts commit 874a11e9821c0e2d230ab88c535486930b7c639e. --- src/pretix/plugins/sendmail/views.py | 2 +- src/tests/plugins/sendmail/test_sendmail.py | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/pretix/plugins/sendmail/views.py b/src/pretix/plugins/sendmail/views.py index 7316f814cb..2f5540f233 100644 --- a/src/pretix/plugins/sendmail/views.py +++ b/src/pretix/plugins/sendmail/views.py @@ -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' diff --git a/src/tests/plugins/sendmail/test_sendmail.py b/src/tests/plugins/sendmail/test_sendmail.py index 9ea35a03a9..932df92d8d 100644 --- a/src/tests/plugins/sendmail/test_sendmail.py +++ b/src/tests/plugins/sendmail/test_sendmail.py @@ -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