Skip to content

Commit

Permalink
Add docstrings to mail fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
kosdmit authored and bluetech committed Sep 2, 2024
1 parent 829ba56 commit a8e23ce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pytest_django/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ def mailoutbox(
django_mail_patch_dns: None,
_dj_autoclear_mailbox: None,
) -> list[django.core.mail.EmailMessage] | None:
"""A clean email outbox to which Django-generated emails are sent."""
if not django_settings_is_configured():
return None

Expand All @@ -591,13 +592,15 @@ def django_mail_patch_dns(
monkeypatch: pytest.MonkeyPatch,
django_mail_dnsname: str,
) -> None:
"""Patch the server dns name used in email messages."""
from django.core import mail

monkeypatch.setattr(mail.message, "DNS_NAME", django_mail_dnsname)


@pytest.fixture()
def django_mail_dnsname() -> str:
"""Return server dns name for using in email messages."""
return "fake-tests.example.com"


Expand Down

0 comments on commit a8e23ce

Please sign in to comment.