ó
Žâ0_c           @   s@   d  Z  d d l m Z d d l m Z d e f d     YZ d S(   s   
Backend for test environment.
i˙˙˙˙(   t   mail(   t   BaseEmailBackendt   EmailBackendc           B   s    e  Z d  Z d   Z d   Z RS(   sí   A email backend for use during test sessions.

    The test connection stores email messages in a dummy outbox,
    rather than sending them out on the wire.

    The dummy outbox is accessible through the outbox instance attribute.
    c         O   s8   t  t |   j | |   t t d  s4 g  t _ n  d  S(   Nt   outbox(   t   superR   t   __init__t   hasattrR    R   (   t   selft   argst   kwargs(    (    sB   /tmp/pip-unpacked-wheel-BAJOf3/django/core/mail/backends/locmem.pyR      s    c         C   s?   d } x2 | D]* } | j    t j j |  | d 7} q W| S(   s%   Redirect messages to the dummy outboxi    i   (   t   messageR    R   t   append(   R   t   messagest	   msg_countR
   (    (    sB   /tmp/pip-unpacked-wheel-BAJOf3/django/core/mail/backends/locmem.pyt   send_messages   s    
(   t   __name__t
   __module__t   __doc__R   R   (    (    (    sB   /tmp/pip-unpacked-wheel-BAJOf3/django/core/mail/backends/locmem.pyR   	   s   	N(   R   t   django.coreR    t   django.core.mail.backends.baseR   R   (    (    (    sB   /tmp/pip-unpacked-wheel-BAJOf3/django/core/mail/backends/locmem.pyt   <module>   s   