mokey patch mail sending for tests

This commit is contained in:
Colin Goutte 2021-11-24 22:33:34 +01:00
parent 9615404b7f
commit 7f3e576498
2 changed files with 7 additions and 0 deletions

View File

@ -20,8 +20,10 @@ kill_server:
.ONESHELL:
dev_serve:
PAPI_NOMAIL=TRUE \
poetry run uvicorn papi.main:app --reload
cleandb:
rm test_sql_app.db || echo ls

View File

@ -3,6 +3,7 @@ import os
from papi.credentials import api_key, api_secret
nomail = os.getenv('PAPI_NOMAIL', '')
def sendmail(htmlpart, emails, textpart="", subject="Monitorig api"):
@ -19,6 +20,10 @@ def sendmail(htmlpart, emails, textpart="", subject="Monitorig api"):
}
]
}
if nomail:
breakpoint()
print(data)
return
result = mailjet.send.create(data=data)
print(result.status_code)
print(result.json())