I wrote a test for for a signup feature. When I do manually, the signup process sends email to the user, but when I do it with test script the email is not sent. So I was wondering what is happening inside?
And what is the port for the test server? Is there any relation for the test server to send mail with it? Can I specify the test server port?
manage.py test
doesn't run a "test server" at all, and nothing is listening on any port.
Testing emails is fully covered in the docs - as that page shows, you can do from django.core import mail
and then check mail.outbox
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.