o
    ۰c                     @   sT   d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	m
Z
 G dd deZdS )	    )TestCase)mail)Site)User)send_activation_emailsend_password_reset_emailc                   @   s$   e Zd Zdd Zdd Zdd ZdS )SendEmailTestc                 C   s0   t jjddddd| _| j  tj | _d S )Nbrahim	bellahcenzbrahimbellahcen@outlook.combrahimbellahcen123)
first_name	last_nameemailpassword)r   objectscreate_userusersaver   get_currentcurrent_siteself r   8/var/www/html/docker_usevoice/src/apps/accounts/tests.pysetUp	   s   
zSendEmailTest.setUpc                 C   j   t | j| j | ttjd | tjd jd | tjd j| jj	g | 
| jjtjd j dS )z0 Test that activation email is sent to the user    r   z UseVoice. | Account ConfirmationN)r   r   r   assertEquallenr   outboxsubjecttor   assertIndomainbodyr   r   r   r   test_send_activation_email   
   z(SendEmailTest.test_send_activation_emailc                 C   r   )z4 Test that password reset email is sent to the user r   r   zUseVoice. | Password ResetN)r   r   r   r   r   r   r   r    r!   r   r"   r#   r$   r   r   r   r   test_send_password_reset_email#   r&   z,SendEmailTest.test_send_password_reset_emailN)__name__
__module____qualname__r   r%   r'   r   r   r   r   r      s    
r   N)django.testr   django.corer   django.contrib.sites.modelsr   apps.accounts.modelsr   apps.accounts.utilsr   r   r   r   r   r   r   <module>   s    