Django: Test content of email sent
<p>I'm sending out an email to users with a generated link, and I wanna write a test that verifies whether the link is correct, but I can't find a way to get the content of the email inside the test.</p>

<p>Is there a way to do that?</p>

<p>If it helps at all, this is how I'm sending the email:</p>

<pre><code>content = template.render(Context({'my_link': my_link}))
subject = _('Email with link')
msg = EmailMultiAlternatives(subject=subject,
                             from_email='MyWebsite Team &lt;mywebsite@mywebsite.com&gt;',
                             to=[user.email, ])
msg.attach_alternative(content, 'text/html')
msg.send()
</code></pre>