mirror of
https://github.com/pretix/pretix.git
synced 2026-05-03 14:54:04 +00:00
Placeholders in subject were not being replaced because there was no `.format()` called on the subject. This commit creates a context dict that is used for both the body and the subject. It is then replaced using `.format_map()` Fixes https://github.com/pretix/pretix/issues/531
This commit is contained in:
committed by
Raphael Michel
parent
96dd4e02f3
commit
58938fc07c
@@ -213,3 +213,20 @@ def test_sendmail_subevents(logged_in_client, sendmail_url, event, order):
|
||||
|
||||
assert response.status_code == 200
|
||||
assert 'Subevent FOO' in response.rendered_content
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_sendmail_placeholder(logged_in_client, sendmail_url, event, order):
|
||||
djmail.outbox = []
|
||||
response = logged_in_client.post(sendmail_url,
|
||||
{'sendto': 'n',
|
||||
'subject_0': '{code} Test subject',
|
||||
'message_0': 'This is a test file for sending mails.',
|
||||
'action': 'preview'
|
||||
},
|
||||
follow=True)
|
||||
|
||||
assert response.status_code == 200
|
||||
assert 'ORDER1234' in response.rendered_content
|
||||
|
||||
assert len(djmail.outbox) == 0
|
||||
|
||||
Reference in New Issue
Block a user