Пример #1
0
def test_send_reset_token_to_user(default_settings, user):
    """ Deliver a contact email. """

    with current_app.test_request_context():
        with mail.record_messages() as outbox:
            send_reset_token(user)

            assert len(outbox) == 1
            assert "/auth/reset-password" in outbox[0].body  # from /auth/reset-password/<token>
            assert "/auth/reset-password" in outbox[0].html
Пример #2
0
def test_send_activation_token_to_user(default_settings, user):
    """ Deliver a contact email. """

    with current_app.test_request_context():
        with mail.record_messages() as outbox:
            send_activation_token(user.id, user.username, user.email)

            assert len(outbox) == 1
            # from /auth/activate/<token>
            assert "/auth/activate" in outbox[0].body
            assert "/auth/activate" in outbox[0].html
Пример #3
0
def test_send_reset_token_to_user(default_settings, user):
    """ Deliver a contact email. """

    with current_app.test_request_context():
        with mail.record_messages() as outbox:
            send_reset_token(user)

            assert len(outbox) == 1
            # from /auth/reset-password/<token>
            assert "/auth/reset-password" in outbox[0].body
            assert "/auth/reset-password" in outbox[0].html