Coverage for src/tests/modules/identity/conftest.py: 100%
13 statements
« prev ^ index » next coverage.py v7.11.0, created at 2024-01-01 00:00 +0000
« prev ^ index » next coverage.py v7.11.0, created at 2024-01-01 00:00 +0000
1"""Module that defines fixtures for user recovery testing."""
3import pytest
5from kwai_core.template.mail_template import MailTemplate
6from kwai_core.template.template_engine import TemplateEngine
8from tests.fixtures.identity.tokens import * # noqa
9from tests.fixtures.identity.user_invitations import * # noqa
10from tests.fixtures.identity.user_recoveries import * # noqa
11from tests.fixtures.identity.users import * # noqa
14@pytest.fixture(scope="module")
15def recovery_mail_template(template_engine: TemplateEngine) -> MailTemplate:
16 """Returns a template for the user recovery mail."""
17 return MailTemplate(
18 template_engine.create("mail/identity/recover_html"),
19 template_engine.create("mail/identity/recover_txt"),
20 )
23@pytest.fixture(scope="module")
24def user_invitation_mail_template(template_engine: TemplateEngine) -> MailTemplate:
25 """Returns a template for the user invitation mail."""
26 return MailTemplate(
27 template_engine.create("mail/identity/invitation_html"),
28 template_engine.create("mail/identity/invitation_txt"),
29 )