Django testing: find link in email message

I'm trying to test email activation and password reset. How do I filter the email body down to a usable link?

def test_activation(self):
    self.register_user()
    mail.outbox[0].body.find_the_link() # Find the link here
    response = self.client.get(link)
    self.assertEqual(response.status_code, 200)
Вернуться на верх