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 :  /usr/lib64/python2.7/site-packages/django/contrib/formtools/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.7/site-packages/django/contrib/formtools/tests/tests.pyc
�
r�\c@s5ddlmZddlZddlZddlZddlmZddlmZm	Z	ddl
mZddlm
Z
ddlmZddlmZdd	lTd
Zej�Zdejfd��YZe
d
ejjejjee��d�f�defd��Y�Zdejfd��YZdS(i����(tunicode_literalsN(thttp(tpreviewtutils(tTestCase(toverride_settings(tupath(tunittest(t*uDone was called!tTestFormPreviewcBs#eZd�Zd�Zd�ZRS(cCs3tt|�j||�}|jitd6�|S(Nucustom_context(tsuperR	tget_contexttupdatetTrue(tselftrequesttformtcontext((sF/tmp/pip-install-XxeQeY/django/django/contrib/formtools/tests/tests.pyRscCsidd6S(NuWorks!ufield1((RR((sF/tmp/pip-install-XxeQeY/django/django/contrib/formtools/tests/tests.pytget_initialscCs
tjt�S(N(RtHttpResponsetsuccess_string(RRtcleaned_data((sF/tmp/pip-install-XxeQeY/django/django/contrib/formtools/tests/tests.pytdones(t__name__t
__module__RRR(((sF/tmp/pip-install-XxeQeY/django/django/contrib/formtools/tests/tests.pyR	s		t
TEMPLATE_DIRSu	templatestPreviewTestscBsVeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(	u#django.contrib.formtools.tests.urlscCsett|�j�tjt�|_d}||jjd�df|_idd6dd6|_dS(Nu,<input type="hidden" name="%s" value="%s" />ustageu%dufooufield1uasdfufield1_(	R
RtsetUpRtFormPreviewtTestFormtunused_nametinputt	test_data(Rtinput_template((sF/tmp/pip-install-XxeQeY/django/django/contrib/formtools/tests/tests.pyR(s
cCs |j|jjd�d�dS(uA
        Verifies name mangling to get uniue field name.
        ufield1ufield1__N(tassertEqualRR(R((sF/tmp/pip-install-XxeQeY/django/django/contrib/formtools/tests/tests.pyttest_unused_name0scCsn|jjd�}|jd}|j||d�|j|jdt�|j|jdjidd6�dS(u'
        Test contrib.formtools.preview form retrieval.

        Use the client library to see if we can sucessfully retrieve
        the form (mostly testing the setup ROOT_URLCONF
        process). Verify that an additional  hidden input field
        is created to manage the stage.

        u	/preview/iucustom_contextuformuWorks!ufield1N(tclienttgetRtassertContainsR"RR
tinitial(Rtresponsetstage((sF/tmp/pip-install-XxeQeY/django/django/contrib/formtools/tests/tests.pyt
test_form_get6s


cCsi|jjidd6tjddd�d6�|jjd|j�}|jd}|j||d�d	S(
u
        Test contrib.formtools.preview form preview rendering.

        Use the client library to POST to the form to see if a preview
        is returned.  If we do get a form back check that the hidden
        value is correctly managing the state of the form.

        iustagei�i
iudate1u	/preview/iN(R RtdatetimetdateR$tpostRR&(RR(R)((sF/tmp/pip-install-XxeQeY/django/django/contrib/formtools/tests/tests.pyttest_form_previewFs-
cCs�|jjidd6tjddd�d6�|jjd|j�}|j|jt�|j	j
d	t|j��}|jji|d6�|jjd|j�}|j
|jt�d	S(
u1
        Test contrib.formtools.preview form submittal.

        Use the client library to POST to the form with stage set to 3
        to see if our forms done() method is called. Check first
        without the security hash, verify failure, retry with security
        hash and verify sucess.

        iustagei�i
iudate1u	/preview/uhashN(R RR+R,R$R-tassertNotEqualtcontenttsuccess_string_encodedRt
security_hashtNoneRR"(RR(thash((sF/tmp/pip-install-XxeQeY/django/django/contrib/formtools/tests/tests.pyttest_form_submitWs-cCs�|jjidd6�|jjdt|j��}|jji|d6dd6�tjdt��0|j	j
d|j�}|j|jt
�WdQXdS(	uS
        Test contrib.formtools.preview form submittal when form contains:
        BooleanField(required=False)

        Ticket: #6209 - When an unchecked BooleanField is previewed, the preview
        form's hash would be computed with no value for ``bool1``. However, when
        the preview form is rendered, the unchecked hidden BooleanField would be
        rendered with the string value 'False'. So when the preview form is
        resubmitted, the hash would be computed with the value 'False' for
        ``bool1``. We need to make sure the hashes are the same in both cases.

        iustageuhashuFalseubool1trecordu	/preview/N(R RRR2R3Rtwarningstcatch_warningsR
R$R-R"R0R1(RR4R(((sF/tmp/pip-install-XxeQeY/django/django/contrib/formtools/tests/tests.pyttest_bool_submitks
cCs�|jjidd6�|jjd|j�}|j|jt�tjt	|j��}|jji|d6�|jjd|j�}|j
|jt�dS(u]
        Test contrib.formtools.preview form submittal, using a correct
        hash
        iustageu	/preview/uhashN(R RR$R-R/R0R1Rt	form_hmacRR"(RR(R4((sF/tmp/pip-install-XxeQeY/django/django/contrib/formtools/tests/tests.pyttest_form_submit_good_hashscCs�|jjidd6�|jjd|j�}|j|jd�|j|jt�t	j
t|j��d}|jji|d6�|jjd|j�}|j|jt�dS(	ur
        Test contrib.formtools.preview form submittal does not proceed
        if the hash is incorrect.
        iustageu	/preview/i�ubaduhashu/previewpreview/N(R RR$R-R"tstatus_codeR/R0R1RR:R(RR(R4((sF/tmp/pip-install-XxeQeY/django/django/contrib/formtools/tests/tests.pyttest_form_submit_bad_hash�s(RRturlsRR#R*R.R5R9R;R=(((sF/tmp/pip-install-XxeQeY/django/django/contrib/formtools/tests/tests.pyR s							t
FormHmacTestscBseZd�Zd�ZRS(cCsftidd6dd6�}tidd6dd6�}tj|�}tj|�}|j||�dS(u�
        Regression test for #10034: the hash generation function should ignore
        leading/trailing whitespace so as to be friendly to broken browsers that
        submit it (usually in textareas).
        ujoeunameuSpeaking español.ubiou  joeuSpeaking español.  N(tHashTestFormRR:R"(Rtf1tf2thash1thash2((sF/tmp/pip-install-XxeQeY/django/django/contrib/formtools/tests/tests.pyttest_textfield_hash�s
cCsPti�}tidt�}tj|�}tj|�}|j||�dS(u�
        Regression test for #10643: the security hash should allow forms with
        empty_permitted = True, or forms where data has not changed.
        tempty_permittedN(tHashTestBlankFormR@R
RR:R"(RRARBRCRD((sF/tmp/pip-install-XxeQeY/django/django/contrib/formtools/tests/tests.pyttest_empty_permitted�s
(RRRERH(((sF/tmp/pip-install-XxeQeY/django/django/contrib/formtools/tests/tests.pyR?�s	(t
__future__RR+tosR7tdjangoRtdjango.contrib.formtoolsRRtdjango.testRtdjango.test.utilsRtdjango.utils._osRtdjango.utilsRt$django.contrib.formtools.tests.formsRtencodeR1RR	tpathtjointdirnamet__file__RR?(((sF/tmp/pip-install-XxeQeY/django/django/contrib/formtools/tests/tests.pyt<module>s"
-{

https://t.me/AnonymousX5 - 2025