mirror of
https://github.com/chatmail/relay.git
synced 2026-08-30 03:53:14 +00:00
Add tests for alternate mail subjects
This commit is contained in:
committed by
holger krekel
parent
c6b083472f
commit
c1fd573de2
@@ -71,11 +71,11 @@ def maildata(request):
|
||||
|
||||
assert datadir.exists(), datadir
|
||||
|
||||
def maildata(name, from_addr, to_addr):
|
||||
def maildata(name, **kwargs):
|
||||
# Using `.read_bytes().decode()` instead of `.read_text()` to preserve newlines.
|
||||
data = datadir.joinpath(name).read_bytes().decode()
|
||||
|
||||
text = data.format(from_addr=from_addr, to_addr=to_addr)
|
||||
text = data.format(**kwargs)
|
||||
return BytesParser(policy=policy.default).parsebytes(text.encode())
|
||||
|
||||
return maildata
|
||||
|
||||
Reference in New Issue
Block a user