File: test_fixtures_mail.py

package info (click to toggle)
python-pytest-djangoapp 1.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 396 kB
  • sloc: python: 1,116; makefile: 114; sh: 6
file content (13 lines) | stat: -rw-r--r-- 309 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
from django.core.mail import send_mail


def test_mail_outbox(mail_outbox):

    send_mail(
        'Subject here', 'Here is the message.',
        'from@example.com', ['to@example.com'],
        fail_silently=False,
    )

    assert len(mail_outbox) == 1
    assert mail_outbox[0].subject == 'Subject here'