2👍
✅
import subprocess
ret = subprocess.call(['python', 'manage.py', 'test'])
if ret == 0:
print("Tests Passed Successfully")
else:
print("Tests failed")
👤nwk
0👍
You could simply write another Python script to generate and send the email(s).
#!/bin/bash
TEST_RESULT=`python manage.py test`
rc=$?;
if [[ $rc -eq 0 ]]
then
python sendemail.py Success
else
python sendemail.py Failure
fi
See the email
documentation: https://docs.python.org/3/library/email-examples.html
- [Answered ]-Simplest way to override Django admin inline to request formfield_for_dbfield for each instance
- [Answered ]-How to execute code on save in Django User model?
Source:stackexchange.com