from django.test import TestCase from django.core import mail class TestSomething(TestCase): def test_something_in_something(self): # run whatever code that is supposed to send emails self.assertEqual(len(mail.outbox), 1) msg = mail.outbox[0] self.assertItemsEqual(msg.recipients(), ['email@example.com']) self.assertEqual(msg.subject, 'Subject') url = 'https://example.com%s' % reverse('url_name') self.assertIn(url, msg.body) # verification urls, change password urls etc. when applicable self.assertIn('Specific text like comments on why something was accepted/rejected', msg.body)