HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/buyercall_forms/buyercall/buyercall/tests/user/test_tasks.py
from buyercall.extensions import mail
from buyercall.blueprints.user.tasks import deliver_password_reset_email
from buyercall.blueprints.user.models import User


class TestTasks(object):
    def test_deliver_password_reset_email(self, token):
        """ Deliver a password reset email. """
        with mail.record_messages() as outbox:
            user = User.find_by_identity('admin@localhost.com')
            deliver_password_reset_email(user.id, token)
            assert len(outbox) == 1
            assert token in outbox[0].html