o
    Lf                     @   s   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	 d dl
mZ d dlmZ d dlmZmZ ejd	d
d dgZedejjejjddddddd	G dd deZdS )    )get_user_model)
validators)Client)override_settings)reverse)app_settings)user_logged_out)MockTestCasez^[a-c]+$znot abc)regexmessageflagshttpsNz/accounts/profile/z/accounts/welcome/z-allauth.account.adapter.DefaultAccountAdapterT)	ACCOUNT_DEFAULT_HTTP_PROTOCOLACCOUNT_EMAIL_VERIFICATIONACCOUNT_AUTHENTICATION_METHODACCOUNT_SIGNUP_FORM_CLASSACCOUNT_EMAIL_SUBJECT_PREFIXLOGIN_REDIRECT_URLACCOUNT_SIGNUP_REDIRECT_URLACCOUNT_ADAPTERACCOUNT_USERNAME_REQUIREDc                   @   s8   e Zd Zedddd Zedddd Zdd	 Zd
S )LogoutTestsT)ACCOUNT_LOGOUT_ON_GETc                 C   s   |  d\}}| |d d S )Ngetaccount/messages/logged_out.txt)_logout_viewassertTemplateUsed)selfcresp r!   b/var/www/html/humari/django-venv/lib/python3.10/site-packages/allauth/account/tests/test_logout.pytest_logout_view_on_get   s   z#LogoutTests.test_logout_view_on_getFc                 C   sz   |  d\}}| |dtj  t }t| |td}| |d |j	t
 |jt
 jjddtd t| d S )Nr   zaccount/logout.%saccount_logoutr   john)username)senderrequestusersignal)r   r   r   TEMPLATE_EXTENSIONr	   r   connectpostr   assert_called_once_withr   wsgi_requestobjectsr   
disconnect)r   r   r    receiver_mockr!   r!   r"   test_logout_view_on_post"   s   

z$LogoutTests.test_logout_view_on_postc                 C   sT   t  }t jjddd}|d |  t  }|jddd |t||tdfS )Nr%   T)r&   	is_activedoe)r&   passwordr$   )	r   r   r0   createset_passwordsavelogingetattrr   )r   methodr   r)   r!   r!   r"   r   8   s   
zLogoutTests._logout_viewN)__name__
__module____qualname__r   r#   r3   r   r!   r!   r!   r"   r      s    

r   )django.contrib.authr   django.corer   django.test.clientr   django.test.utilsr   django.urlsr   allauth.accountr   allauth.account.signalsr   allauth.testsr	   r
   RegexValidatortest_username_validatorsEmailVerificationMethod	MANDATORYAuthenticationMethodUSERNAMEr   r!   r!   r!   r"   <module>   s,    