Beispiel #1
0
 def test_send_email(self):
     testuser = user(username='******', email='*****@*****.**')
     testuser.set_unusable_password()
     testuser.save()
     send_recovery_email(testuser.pk, email='*****@*****.**')
     testuser.refresh_from_db()
     assert testuser.has_usable_password()
     recovery_url = testuser.get_recovery_url()
     assert len(mail.outbox) == 1
     recovery_email = mail.outbox[0]
     assert recovery_email.to == ['*****@*****.**']
     assert recovery_url in recovery_email.body
     assert testuser.username in recovery_email.subject
Beispiel #2
0
 def test_send_email(self):
     testuser = user(username='******', email='*****@*****.**')
     testuser.set_unusable_password()
     testuser.save()
     send_recovery_email(testuser.pk, email='*****@*****.**')
     testuser.refresh_from_db()
     assert testuser.has_usable_password()
     recovery_url = testuser.get_recovery_url()
     assert len(mail.outbox) == 1
     recovery_email = mail.outbox[0]
     assert recovery_email.to == ['*****@*****.**']
     assert recovery_url in recovery_email.body
     assert testuser.username in recovery_email.subject