mirror of
https://github.com/chatmail/relay.git
synced 2026-05-20 12:58:04 +00:00
tests: fix tests for new fastCGI route and DKIM responses
This commit is contained in:
@@ -9,7 +9,7 @@ def test_gen_qr_png_data(maildomain):
|
|||||||
|
|
||||||
|
|
||||||
def test_fastcgi_working(maildomain, chatmail_config):
|
def test_fastcgi_working(maildomain, chatmail_config):
|
||||||
url = f"https://{maildomain}/cgi-bin/newemail.py"
|
url = f"https://{maildomain}/new"
|
||||||
print(url)
|
print(url)
|
||||||
res = requests.post(url)
|
res = requests.post(url)
|
||||||
assert maildomain in res.json().get("email")
|
assert maildomain in res.json().get("email")
|
||||||
@@ -18,7 +18,7 @@ def test_fastcgi_working(maildomain, chatmail_config):
|
|||||||
|
|
||||||
def test_newemail_configure(maildomain, rpc):
|
def test_newemail_configure(maildomain, rpc):
|
||||||
"""Test configuring accounts by scanning a QR code works."""
|
"""Test configuring accounts by scanning a QR code works."""
|
||||||
url = f"DCACCOUNT:https://{maildomain}/cgi-bin/newemail.py"
|
url = f"DCACCOUNT:https://{maildomain}/new"
|
||||||
for i in range(3):
|
for i in range(3):
|
||||||
account_id = rpc.add_account()
|
account_id = rpc.add_account()
|
||||||
rpc.set_config_from_qr(account_id, url)
|
rpc.set_config_from_qr(account_id, url)
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ def test_reject_missing_dkim(cmsetup, maildata, from_addr):
|
|||||||
recipient = cmsetup.gen_users(1)[0]
|
recipient = cmsetup.gen_users(1)[0]
|
||||||
msg = maildata("plain.eml", from_addr=from_addr, to_addr=recipient.addr).as_string()
|
msg = maildata("plain.eml", from_addr=from_addr, to_addr=recipient.addr).as_string()
|
||||||
with smtplib.SMTP(cmsetup.maildomain, 25) as s:
|
with smtplib.SMTP(cmsetup.maildomain, 25) as s:
|
||||||
with pytest.raises(smtplib.SMTPDataError, match="Spam message rejected"):
|
with pytest.raises(smtplib.SMTPDataError, match="missing DKIM signature"):
|
||||||
s.sendmail(from_addr=from_addr, to_addrs=recipient.addr, msg=msg)
|
s.sendmail(from_addr=from_addr, to_addrs=recipient.addr, msg=msg)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user