
    f                         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
      gZ edej&                  j(                  ej*                  j,                  dddddd	       G d de             Zy)    )get_user_model)
validators)Client)override_settings)reverse)app_settings)user_logged_out)MockTestCasez^[a-c]+$znot abc)regexmessage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                   N    e Zd Z ed      d        Z ed      d        Zd Zy)LogoutTestsT)ACCOUNT_LOGOUT_ON_GETc                 P    | j                  d      \  }}| j                  |d       y )Ngetaccount/messages/logged_out.txt)_logout_viewassertTemplateUsed)selfcresps      \/var/www/cs2snipe.com/venv/lib/python3.12/site-packages/allauth/account/tests/test_logout.pytest_logout_view_on_getz#LogoutTests.test_logout_view_on_get   s'    ##E*4&GH    Fc                    | j                  d      \  }}| j                  |dt        j                  z         t	               }t        j                  |       |j                  t        d            }| j                  |d       |j                  t               |j                  t               j                  j                  d      t
               t        j                  |       y )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_mocks       r#   test_logout_view_on_postz$LogoutTests.test_logout_view_on_post"   s    ##E*4%(G(GG	
 .vvg./0&GH--!#%%!))--v->"	 	. 	
 	""=1r%   c                    t               }t               j                  j                  dd      }|j	                  d       |j                          t               }|j                  dd       | t        ||      t        d            fS )Nr(   T)r)   	is_activedoe)r)   passwordr'   )	r   r   r3   createset_passwordsavelogingetattrr   )r    methodr!   r,   s       r#   r   zLogoutTests._logout_view8   su    H''..$.O% 		H	%0$'!V$W-=%>???r%   N)__name__
__module____qualname__r   r$   r6   r    r%   r#   r   r      s<     T2I 3I U32 42*@r%   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   rD   r%   r#   <module>rS      s    . " % /  ( 3 ( JKC 
 ")+CCMM"."C"C"L"L"!%+ 4C"
#@( #@
#@r%   