mokey patch mail sending for tests
This commit is contained in:
parent
9615404b7f
commit
7f3e576498
2
Makefile
2
Makefile
|
@ -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
|
||||
|
||||
|
|
|
@ -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())
|
||||
|
|
Loading…
Reference in New Issue