Skip to content

Commit

Permalink
Fixed a typo and clarified how django.core.mail.outbox works in the t…
Browse files Browse the repository at this point in the history
…esting framework. Fixed #9237.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9140 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Oct 5, 2008
1 parent 7e4d277 commit 5cd7af5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion docs/topics/testing.txt
Expand Up @@ -950,7 +950,7 @@ Django, such as your machine's mail server, if you're running one.)


.. currentmodule:: django.core.mail .. currentmodule:: django.core.mail


.. data:: django.core.mail.output .. data:: django.core.mail.outbox


During test running, each outgoing e-mail is saved in During test running, each outgoing e-mail is saved in
``django.core.mail.outbox``. This is a simple list of all ``django.core.mail.outbox``. This is a simple list of all
Expand All @@ -961,6 +961,11 @@ dummy :class:`<~django.core.mail.SMTPConnection>`. When the test framework is
torn down, the standard :class:`<~django.core.mail.SMTPConnection>` class is torn down, the standard :class:`<~django.core.mail.SMTPConnection>` class is
restored, and the test outbox is destroyed. restored, and the test outbox is destroyed.


The ``outbox`` attribute is a special attribute that is created *only* when
the tests are run. It doesn't normally exist as part of the
:mod:`django.core.mail` module and you can't import it directly. The code
below shows how to access this attribute correctly.

Here's an example test that examines ``django.core.mail.outbox`` for length Here's an example test that examines ``django.core.mail.outbox`` for length
and contents:: and contents::


Expand Down

0 comments on commit 5cd7af5

Please sign in to comment.