Ejemplo n.º 1
0
def test_send_email():
    send_activation_code_async.delay(1, str(uuid4()))
    emails = mail.outbox
    assert len(emails) == 1

    email = mail.outbox[0]
    assert email.subject == 'Your activation code'
Ejemplo n.º 2
0
def test_send_email():
    from django.core import mail
    from account.tasks import send_activation_code_async
    from uuid import uuid4

    emails = mail.outbox
    print('EMAILS:', emails)

    send_activation_code_async.delay(1, str(uuid4()))
    emails = mail.outbox
    assert len(emails) == 1

    email = mail.outbox[0]
    assert email.subject == 'Your activation code'
Ejemplo n.º 3
0
 def send_activation_code(self):
     send_activation_code_async.delay(self.user.email, self.code)