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_views.pyc
�
r�\c
@s8ddlZddlZddlZddlmZmZddlmZmZddl	m
Z
ddlmZddl
mZddlmZmZddlmZmZdd	lmZdd
lmZmZmZddlmZmZddlmZdd
l m!Z!ddl"m#Z#ddl$m%Z%m&Z&ddl'm(Z(ddl)m*Z*ddl+m,Z,m-Z-ddl.m/Z/m0Z0m1Z1ddl2m3Z3ddl4m5Z5ddl6m7Z8e%dd8dddej9dej:j;ej:j<e!e=��d�fde>dd9�d!e#fd"��Y�Z?e5d#e?fd$��Y�Z@e5d%e?fd&��Y�ZAe%d'd(�d)e?fd*��Y�ZBe5d+e?fd,��Y�ZCe5d-e?fd.��Y�ZDe5d/e?fd0��Y�ZEe5d1e?fd2��Y�ZFe5d3e?fd4��Y�ZGe5e%dd:�d5e?fd6��Y��ZHdS(;i����N(tglobal_settingstsettings(tSitetRequestSite(tLogEntry(tUser(tmail(treversetNoReverseMatch(t	QueryDicttHttpRequest(t
force_text(t
int_to_base36turlsafe_base64_decodeturlquote(turlparsetParseResult(t
import_module(tupath(tTestCase(toverride_settingstpatch_logger(tCsrfViewMiddleware(tSessionMiddleware(tSESSION_KEYtREDIRECT_FIELD_NAME(tAuthenticationFormtPasswordChangeFormtSetPasswordForm(t
CustomUser(tskipIfCustomUser(tlogint	LANGUAGEStentEnglisht
LANGUAGE_CODEtTEMPLATE_LOADERSt
TEMPLATE_DIRSt	templatestUSE_TZtPASSWORD_HASHERSs.django.contrib.auth.hashers.SHA1PasswordHashertAuthViewsTestCasecBsGeZdZdgZdZdd�Zd�Zd�Zed�Z	RS(s:
    Helper base class for all the follow test cases.
    sauthtestdata.jsonsdjango.contrib.auth.tests.urlstpasswordcCs@|jjdidd6|d6�}|jt|jjk�|S(Ns/login/t
testclienttusernameR*(tclienttpostt
assertTrueRtsession(tselfR*tresponse((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyR1s

cCsB|jjd�}|j|jd�|jt|jjk�dS(Ns/admin/logout/i�(R-tgettassertEqualtstatus_codeR/RR0(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pytlogout9scCs?ttj|jdjj���}|jt|�|�dS(s=Assert that error is found in response.context['form'] errorstformN(tlistt	itertoolstchaintcontextterrorstvaluestassertInR(R1R2terrortform_errors((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pytassertFormError>s%c	Cs�tj}x�t|t|�t|��D]r\}}}|re|dkret|�t|�}}n|r(|r(||kr(|jd|||f�q(q(WdS(s�
        Given two URLs, make sure all their components (the ones given by
        urlparse) are equal, only comparing components that are present in both
        URLs.
        If `parse_qs` is True, then the querystrings are parsed with QueryDict.
        This is useful if you don't want the order of parameters to matter.
        Otherwise, the query strings are compared as-is.
        tquerys%r != %r (%s doesn't match)N(Rt_fieldstzipRR	tfail(R1turltexpectedtparse_qstfieldstattrtxty((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pytassertURLEqualCs		.(
t__name__t
__module__t__doc__tfixturesturlsRR6RAtFalseRM(((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyR)s			tAuthViewNamedURLTestscBseZdZd�ZRS(sdjango.contrib.auth.urlscCs�dgifdgifdgifdgifdgifdgifdgidd	6d
d6fdgifg}xV|D]N\}}}yt|d
|d|�Wq{tk
r�|jd|�q{Xq{WdS(sNamed URLs should be reversibleRR6tpassword_changetpassword_change_donetpassword_resettpassword_reset_donetpassword_reset_confirmtaaaaaaatuidb64s
1111-aaaaattokentpassword_reset_completetargstkwargss5Reversal of url named '%s' failed with NoReverseMatchN(RRRE(R1texpected_named_urlstnameR^R_((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_named_urlsYs	

(RNRORRRb(((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyRTUstPasswordResetTestcBseZd�Zd�Zd�Zeddg�d��Zede�d��Zede�d��Z	d	�Z
d
�Zd�Zd�Z
d
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cCsq|jjd�}|j|jd�|jjdidd6�}|j|jd�|jttj�d�dS(seIf the provided email is not registered, don't raise any error but
        also don't send any email.s/password_reset/i�snot_a_real_email@email.comtemaili.iN(R-R3R4R5R.tlenRtoutbox(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_email_not_foundrs
cCs�|jjdidd6�}|j|jd�|jttj�d�|jdtjdjk�|jt	j
tjdj�dS(	sEEmail is sent if a valid email address is provided for password resets/password_reset/sstaffmember@example.comRdi.ishttp://iN(R-R.R4R5ReRRfR/tbodyRtDEFAULT_FROM_EMAILt
from_email(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_email_found{s
cCsf|jjdidd6�}|j|jd�|jttj�d�|jdtjdj�dS(skEmail is sent if a valid email address is provided for password reset when a custom from_email is provided.s/password_reset_from_email/sstaffmember@example.comRdi.iiN(R-R.R4R5ReRRfRj(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_email_found_custom_from�st
ALLOWED_HOSTSs
adminsite.comcCs�|jjdidd6dd�}|j|jd�|jttj�d�|jdtjd	jk�|jt	j
tjd	j�d
S(scIf the reset view is marked as being for admin, the HTTP_HOST header is used for a domain override.s/admin_password_reset/sstaffmember@example.comRdt	HTTP_HOSTs
adminsite.comi.ishttp://adminsite.comiN(R-R.R4R5ReRRfR/RhRRiRj(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_admin_reset�s
	tDEBUG_PROPAGATE_EXCEPTIONSc	Cs�tdd��k}|jjdidd6dd�}|j|jd�|jttj�d	�|jt|�d
�WdQXdS(s9Poisoned HTTP_HOST headers can't be used for reset emailssdjango.security.DisallowedHostR?s/password_reset/sstaffmember@example.comRdRns$www.example:dr.frankenstein@evil.tldi�iiN(RR-R.R4R5ReRRf(R1tlogger_callsR2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_poisoned_http_host�s

	c	Cs�tdd��k}|jjdidd6dd�}|j|jd�|jttj�d	�|jt|�d
�WdQXdS(sHPoisoned HTTP_HOST headers can't be used for reset emails on admin viewssdjango.security.DisallowedHostR?s/admin_password_reset/sstaffmember@example.comRdRns$www.example:dr.frankenstein@evil.tldi�iiN(RR-R.R4R5ReRRf(R1RqR2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt"test_poisoned_http_host_admin_site�s
	cCsI|jjdidd6�}|jttj�d�|jtjd�S(Ns/password_reset/sstaffmember@example.comRdii(R-R.R4ReRRft_read_signup_email(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt_test_confirm_start�scCsEtjd|j�}|j|dk	d�|j�|j�dfS(Nshttps?://[^/]*(/.*reset/\S*)sNo URL found in sent emaili(tretsearchRhR/tNonetgrouptgroups(R1Rdturlmatch((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyRt�scCs8|j�\}}|jj|�}|j|d�dS(NsPlease enter your new password(RuR-R3tassertContains(R1RFtpathR2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_confirm_valid�scCsz|j�\}}|jd�jd�}ttt|d���|d<|jjdt|��}|j	|d�dS(Nt/is
/%s/%s-%s/sPlease enter your new password(
RutstriptsplitRtintR
R-R3ttupleR|(R1RFR}t
path_partsR2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_confirm_valid_base36�s
 cCsN|j�\}}|d d|d}|jj|�}|j|d�dS(Ni����t0ii����s#The password reset link was invalidt0000(RuR-R3R|(R1RFR}R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_confirm_invalid�scCs&|jjd�}|j|d�dS(Ns/reset/123456/1-1/s#The password reset link was invalid(R-R3R|(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_confirm_invalid_user�scCs&|jjd�}|j|d�dS(Ns/reset/123456-1-1/s#The password reset link was invalid(R-R3R|(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt test_confirm_invalid_user_base36�scCs&|jjd�}|j|d�dS(Ns/reset/zzzzzzzzzzzzz/1-1/s#The password reset link was invalid(R-R3R|(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_confirm_overflow_user�scCs&|jjd�}|j|d�dS(Ns/reset/zzzzzzzzzzzzz-1-1/s#The password reset link was invalid(R-R3R|(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt!test_confirm_overflow_user_base36�scCsy|j�\}}|d d|d}|jj|idd6dd6�tjjd	d
�}|j|jd��dS(Ni����R�ii����tanewpasswordt
new_password1s
 anewpasswordt
new_password2Rdsstaffmember@example.comR�(RuR-R.RtobjectsR3R/tcheck_password(R1RFR}tu((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_confirm_invalid_post�scCs�|j�\}}|jj|idd6dd6�}tjjdd�}|j|jd��|jj|�}|j|d�dS(NR�R�R�Rdsstaffmember@example.coms#The password reset link was invalid(	RuR-R.RR�R3R/R�R|(R1RFR}R2R�((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_confirm_complete�s
cCsP|j�\}}|jj|idd6dd6�}|j|tjd�dS(NR�R�RKR�tpassword_mismatch(RuR-R.RARterror_messages(R1RFR}R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt test_confirm_different_passwords
s
cCsF|jjdidd6�}|j|jd�|j|jd�dS(Ns/password_reset/sstaffmember@example.comRdi.s/password_reset/done/(R-R.R4R5RMRF(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_reset_redirect_defaultscCsF|jjdidd6�}|j|jd�|j|jd�dS(Ns /password_reset/custom_redirect/sstaffmember@example.comRdi.s/custom/(R-R.R4R5RMRF(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_reset_custom_redirectscCsF|jjdidd6�}|j|jd�|j|jd�dS(Ns&/password_reset/custom_redirect/named/sstaffmember@example.comRdi.s/password_reset/(R-R.R4R5RMRF(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt test_reset_custom_redirect_namedscCs_|j�\}}|jj|idd6dd6�}|j|jd�|j|jd�dS(NR�R�R�i.s/reset/done/(RuR-R.R4R5RMRF(R1RFR}R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_confirm_redirect_default"s

cCsq|j�\}}|jdd�}|jj|idd6dd6�}|j|jd�|j|jd�dS(Ns/reset/s/reset/custom/R�R�R�i.s/custom/(RutreplaceR-R.R4R5RMRF(R1RFR}R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_confirm_redirect_custom)s
cCsq|j�\}}|jdd�}|jj|idd6dd6�}|j|jd�|j|jd�dS(Ns/reset/s/reset/custom/named/R�R�R�i.s/password_reset/(RuR�R-R.R4R5RMRF(R1RFR}R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt"test_confirm_redirect_custom_named1s
(RNRORgRkRlRRotTrueRrRsRuRtR~R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�(((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyRcos0				

				
														tAUTH_USER_MODELsauth.CustomUsertCustomUserPasswordResetTestcBs,eZdgZd�Zd�Zd�ZRS(scustom_user.jsoncCs\|jjdidd6�}|j|jd�|jttj�d�|jtjd�S(Ns/password_reset/sstaffmember@example.comRdi.ii(R-R.R4R5ReRRfRt(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyRu>scCsEtjd|j�}|j|dk	d�|j�|j�dfS(Nshttps?://[^/]*(/.*reset/\S*)sNo URL found in sent emaili(RvRwRhR/RxRyRz(R1RdR{((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyRtEscCs8|j�\}}|jj|�}|j|d�dS(NsPlease enter your new password(RuR-R3R|(R1RFR}R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_confirm_valid_custom_userJs(RNRORQRuRtR�(((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyR�:s			tChangePasswordTestcBsteZdd�Zd�Zd�Zd�Zd�Zd�Zedd�d	��Z	d
�Z
d�Zd�ZRS(
R*cCsX|jjdidd6|d6�}|j|tjditjjd�jd6�dS(Ns/login/R+R,R*t
invalid_login(	R-R.RARR�Rt_metat	get_fieldtverbose_name(R1R*R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt
fail_loginTs

cCs|jjd�}dS(Ns/logout/(R-R3(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyR6]scCsO|j�|jjdidd6dd6dd6�}|j|tjd�dS(Ns/password_change/tdonutstold_passwordt	password1R�R�tpassword_incorrect(RR-R.RARR�(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt4test_password_change_fails_with_invalid_old_password`s

cCsO|j�|jjdidd6dd6dd6�}|j|tjd�dS(	Ns/password_change/R*R�R�R�R�R�R�(RR-R.RARR�(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt4test_password_change_fails_with_mismatched_passwordsis

cCsR|j�|jjdidd6dd6dd6�}|j�|jdd�dS(Ns/password_change/R*R�R�R�R�(RR-R.R�(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_password_change_succeedsrs


cCs^|j�|jjdidd6dd6dd6�}|j|jd�|j|jd�dS(	Ns/password_change/R*R�R�R�R�i.s/password_change/done/(RR-R.R4R5RMRF(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt"test_password_change_done_succeeds|s

t	LOGIN_URLs/login/cCs<|jjd�}|j|jd�|j|jd�dS(Ns/password_change/done/i.s#/login/?next=/password_change/done/(R-R3R4R5RMRF(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_password_change_done_fails�scCs^|j�|jjdidd6dd6dd6�}|j|jd�|j|jd�dS(	Ns/password_change/R*R�R�R�R�i.s/password_change/done/(RR-R.R4R5RMRF(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt%test_password_change_redirect_default�s

cCs^|j�|jjdidd6dd6dd6�}|j|jd�|j|jd�dS(	Ns/password_change/custom/R*R�R�R�R�i.s/custom/(RR-R.R4R5RMRF(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt$test_password_change_redirect_custom�s

cCs^|j�|jjdidd6dd6dd6�}|j|jd�|j|jd�dS(	Ns/password_change/custom/named/R*R�R�R�R�i.s/password_reset/(RR-R.R4R5RMRF(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt*test_password_change_redirect_custom_named�s

(
RNROR�R6R�R�R�R�RR�R�R�R�(((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyR�Qs							
	
	
	
t	LoginTestcBs2eZd�Zdd�Zd�Zdd�ZRS(cCs�|jjtd��}|j|jd�tjjrztjj	�}|j|j
d|�|j|j
d|j�n|j|j
dt
�|jt|j
dt�d�dS(NRi�tsitet	site_nameR7s'Login form is not an AuthenticationForm(R-R3RR4R5RR�t	installedR�tget_currentR;RatassertIsInstanceRR/t
isinstanceR(R1R2R�((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt(test_current_site_in_context_after_login�sR*cCs"td�}x�dD]~}d	i|d
6td6t|�d6}|jj|id
d6|d6�}|j|jd�|j||jkd|�qWx�dD]~}di|d
6td6t|�d6}|jj|id
d6|d6�}|j|jd�|j	||jkd|�q�WdS(NRshttp://example.comshttp:///example.comshttps://example.comsftp://exampel.coms///example.coms
//example.comsjavascript:alert("XSS")s%(url)s?%(next)s=%(bad_url)sRFtnexttbad_urlR+R,R*i.s%s should be blockeds/view/?param=http://example.coms /view/?param=https://example.coms/view?param=ftp://exampel.comsview/?param=//example.comshttps://testserver/sHTTPS://testserver/s
//testserver/s/url%20with%20spaces/s%(url)s?%(next)s=%(good_url)stgood_urls%s should be allowed(shttp://example.comshttp:///example.comshttps://example.comsftp://exampel.coms///example.coms
//example.comsjavascript:alert("XSS")(s/view/?param=http://example.coms /view/?param=https://example.coms/view?param=ftp://exampel.comsview/?param=//example.comshttps://testserver/sHTTPS://testserver/s
//testserver/s/url%20with%20spaces/(
RRRR-R.R4R5tassertFalseRFR/(R1R*t	login_urlR�t	nasty_urlR2R�tsafe_url((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_security_check�sH



cCs-|jjdidd6dd6dt�}dS(Ns/custom_requestauth_login/R+R,R*tfollow(R-R.R�(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt test_login_form_contains_request�s
cCsVt�}t�j|tdi�t|jd<t|�}t�j||�}|jjt	j
d�}|j}t�}||j
t	j
<d|_idd6|d6|d6|_|j|_t�j|�t�j|td
i�d|jd<d	|jd
<t|�}t�j||�}|jjt	j
d�}|j}|j||�dS(sP
        Makes sure that a login rotates the currently-used CSRF token.
        tCSRF_COOKIE_USEDtPOSTR+R,R*tcsrfmiddlewaretokent
testservertSERVER_NAMEiPtSERVER_PORTN(((R
Rtprocess_viewt
login_viewR�tMETAtprocess_responsetcookiesR3RtCSRF_COOKIE_NAMERxtcoded_valuetCOOKIEStmethodR�tREQUESTRtprocess_requesttassertNotEqual(R1R*treqtresptresp2tcsrf_cookiettoken1ttoken2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_login_csrf_rotate�s*	
			

	(RNROR�R�R�R�(((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyR��s	/		tLoginURLSettingscBs�eZdZed�Zedd�d��Zedd�d��Zedd�d��Zedd	�d
��Z	edd�d��Z
edd
�d��ZRS(sTests for settings.LOGIN_URL.cCsB|jjd�}|j|jd�|j|j|d|�dS(Ns/login_required/i.RH(R-R3R4R5RMRF(R1RFRHR2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pytassertLoginURLEqualssR�s/login/cCs|jd�dS(Ns/login/?next=/login_required/(R�(R1((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_standard_login_urlsRcCs|jd�dS(Ns/login/?next=/login_required/(R�(R1((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_named_login_url!sshttp://remote.example.com/logincCs'td�}d|}|j|�dS(Ns!http://testserver/login_required/s'http://remote.example.com/login?next=%s(RR�(R1tquoted_nextRG((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_remote_login_url%s
shttps:///login/cCs'td�}d|}|j|�dS(Ns!http://testserver/login_required/shttps:///login/?next=%s(RR�(R1R�RG((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_https_login_url+s
s/login/?pretty=1cCs|jddt�dS(Ns&/login/?pretty=1&next=/login_required/RH(R�R�(R1((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_login_url_with_querystring1ss/http://remote.example.com/login/?next=/default/cCs'td�}d|}|j|�dS(Ns!http://testserver/login_required/s(http://remote.example.com/login/?next=%s(RR�(R1R�RG((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt+test_remote_login_url_with_next_querystring5s
(RNRORPRSR�RR�R�R�R�R�R�(((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyR�stLoginRedirectUrlTestcBsheZdZd�Zd�Zedd�d��Zedd�d��Zedd�d	��ZRS(
s&Tests for settings.LOGIN_REDIRECT_URL.cCs6|j�}|j|jd�|j|j|�dS(Ni.(RR4R5RMRF(R1RFR2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pytassertLoginRedirectURLEqual?scCs|jd�dS(Ns/accounts/profile/(R�(R1((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_defaultDstLOGIN_REDIRECT_URLs/custom/cCs|jd�dS(Ns/custom/(R�(R1((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_customGsRWcCs|jd�dS(Ns/password_reset/(R�(R1((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt
test_namedKss"http://remote.example.com/welcome/cCs|jd�dS(Ns"http://remote.example.com/welcome/(R�(R1((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_remoteOs(	RNRORPR�R�RR�R�R�(((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyR�<s		t
LogoutTestcBseeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	dd	�Z
d
�ZRS(cCs|jt|jjk�dS(N(R/RR-R0(R1((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pytconfirm_logged_outWscCs:|j�|jjd�}|j|d�|j�dS(s<Logout without next_page option renders the default templates/logout/s
Logged outN(RR-R3R|R�(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_logout_defaultZs
cCs6|j�|jjd�}|jd|jk�dS(Ns/logout/R�(RR-R3R/R;(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt
test_14377as
cCs�|j�|jjd�}|j|jd�|j|jd�|jjd�}|j|jd�|j|jd�|j�dS(Ns/logout/next_page/i.s/somewhere/s/logout/next_page/?next=/login/s/login/(RR-R3R4R5RMRFR�(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt(test_logout_with_overridden_redirect_urlgs
cCsP|j�|jjd�}|j|jd�|j|jd�|j�dS(sBLogout with next_page option given redirects to specified resources/logout/next_page/i.s/somewhere/N(RR-R3R4R5RMRFR�(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt$test_logout_with_next_page_specifiedts

cCsP|j�|jjd�}|j|jd�|j|jd�|j�dS(s8Logout with query string redirects to specified resources/logout/?next=/login/i.s/login/N(RR-R3R4R5RMRFR�(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt"test_logout_with_redirect_argument|s

cCsP|j�|jjd�}|j|jd�|j|jd�|j�dS(s?Logout with custom query string redirects to specified resources(/logout/custom_query/?follow=/somewhere/i.s/somewhere/N(RR-R3R4R5RMRFR�(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt)test_logout_with_custom_redirect_argument�s

cCsP|j�|jjd�}|j|jd�|j|jd�|j�dS(s2Logout resolves names or URLs passed as next_page.s/logout/next_page/named/i.s/password_reset/N(RR-R3R4R5RMRFR�(R1R2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_logout_with_named_redirect�s

R*cCs(td�}x�dD]�}d	i|d
6td6t|�d6}|j�|jj|�}|j|jd
�|j||j	kd|�|j
�qWx�dD]�}di|d
6td6t|�d6}|j�|jj|�}|j|jd
�|j||j	kd|�|j
�q�WdS(NR6shttp://example.comshttp:///example.comshttps://example.comsftp://exampel.coms///example.coms
//example.comsjavascript:alert("XSS")s%(url)s?%(next)s=%(bad_url)sRFR�R�i.s%s should be blockeds/view/?param=http://example.coms /view/?param=https://example.coms/view?param=ftp://exampel.comsview/?param=//example.comshttps://testserver/sHTTPS://testserver/s
//testserver/s/url%20with%20spaces/s%(url)s?%(next)s=%(good_url)sR�s%s should be allowed(shttp://example.comshttp:///example.comshttps://example.comsftp://exampel.coms///example.coms
//example.comsjavascript:alert("XSS")(s/view/?param=http://example.coms /view/?param=https://example.coms/view?param=ftp://exampel.comsview/?param=//example.comshttps://testserver/sHTTPS://testserver/s
//testserver/s/url%20with%20spaces/(RRRRR-R3R4R5R�RFR�R/(R1R*t
logout_urlR�R�R2R�R�((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyR��sH



cCssttj�}|j�}d|d<|j�|j|jjtj<|jj	d�|j
|jjdd�dS(s?Check that language stored in session is preserved after logouttpltdjango_languages/logout/N(RRtSESSION_ENGINEtSessionStoretsavetsession_keyR-R�tSESSION_COOKIE_NAMER3R4R0(R1tengineR0((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_logout_preserve_language�s

(RNROR�R�R�R�R�R�R�R�R�R(((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyR�Ts				
				,tChangelistTestscBsMeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(s$django.contrib.auth.tests.urls_admincCsKtjjdd�jdtdt�|j�tjjdd�|_dS(NR,R+tis_stafftis_superusertpki(RR�tfiltertupdateR�RR3tadmin(R1((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pytsetUp�s%
cCs�i|jd6|jd6|jd6|jd6|jd6|jd6|jjd�d6|jjd	�d
6|jjd�d6|jjd	�d6|jjd�d
6|jjd	�d6|jjd�d6|jjd	�d6|j	d6|j
d6S(NR,R*Rdt	is_activeRRs%Y-%m-%dtlast_login_0s%H:%M:%Stlast_login_1sinitial-last_login_0sinitial-last_login_1t
date_joined_0t
date_joined_1sinitial-date_joined_0sinitial-date_joined_1t
first_namet	last_name(R,R*RdRRRt
last_logintstrftimetdate_joinedRR(R1tuser((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt
get_user_data�s"






cCsWtdd��B}|jjd�}|j|jd�|jt|�d�WdQXdS(Ns*django.security.DisallowedModelAdminLookupR?s,/admin/auth/user/?password__startswith=sha1$i�i(RR-R3R4R5Re(R1RqR2((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt*test_changelist_disallows_password_lookups�scCs||j|j�}d|d|d<|jjd|jj|�}|j|d�tjjd�}|j	|j
d�dS(Ntnew_Rds/admin/auth/user/%s/s/admin/auth/user/tidsChanged email.(RR
R-R.RtassertRedirectsRR�tlatestR4tchange_message(R1tdataR2trow((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_user_change_email�scCsd|jjd|jj|j|j��}|j|d�tjjd�}|j	|j
d�dS(Ns/admin/auth/user/%s/s/admin/auth/user/RsNo fields changed.(R-R.R
RRRRR�RR4R(R1R2R((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_user_not_change�s
cCs�|jjd|jjidd6dd6�}|j|d|jj�tjjd�}|j|j	d�|j
�|jdd�dS(Ns/admin/auth/user/%s/password/R�t	password2s/admin/auth/user/%s/RsChanged password.R*(R-R.R
RRRR�RR4RR6R(R1R2R((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyttest_user_change_passwords

cCs�tjjdd�}|jjd|jidd6dd6�}|j|d|j�tjjd�}|j	|j
|jj�|j	|jt
|j��|j	|jd�dS(	NRdsstaffmember@example.coms/admin/auth/user/%s/password/R�R"s/admin/auth/user/%s/RsChanged password.(RR�R3R-R.RRRRR4tuser_idR
t	object_idtstrR(R1R�R2R((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt(test_user_change_different_user_passwords
(
RNRORRRRRR R!R#R'(((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyR�s						(senR"((senR"(s.django.contrib.auth.hashers.SHA1PasswordHasher(s.django.contrib.auth.hashers.SHA1PasswordHasher(IR9tosRvtdjango.confRRtdjango.contrib.sites.modelsRRtdjango.contrib.admin.modelsRtdjango.contrib.auth.modelsRtdjango.coreRtdjango.core.urlresolversRRtdjango.httpR	R
tdjango.utils.encodingRtdjango.utils.httpRR
Rt#django.utils.six.moves.urllib.parseRRtdjango.utils.importlibRtdjango.utils._osRtdjango.testRtdjango.test.utilsRRtdjango.middleware.csrfRt"django.contrib.sessions.middlewareRtdjango.contrib.authRRtdjango.contrib.auth.formsRRRt%django.contrib.auth.tests.custom_userRtdjango.contrib.auth.tests.utilsRtdjango.contrib.auth.viewsRR�R$R}tjointdirnamet__file__RSR)RTRcR�R�R�R�R�R�R(((sF/tmp/pip-install-XxeQeY/django/django/contrib/auth/tests/test_views.pyt<module>sf	*	+�Yi&x	

https://t.me/AnonymousX5 - 2025