Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

hemamaps / django-crispy-forms   python

Repository URL to install this package:

Version: 1.6.0 

/ tests / test_layout.pyc

ó
w6ÔUc@sÀddlZddlmZddlmZddlmZmZddlmZddl	m
Z
ddlmZm
Z
ddlZyddlmZWn-ek
rÇdd	lmZeƒjZnXdd
lmZddlmZyddlmZWn!ek
rddlmZnXd
dlmZmZmZd
dlmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%ddl&m'Z'ddl(m)Z)ddl*m+Z+ddl,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5ddl6m7Z7d„Z8d„Z9d„Z:d„Z;d„Z<d„Z=d„Z>d„Z?d„Z@d„ZAd„ZBd „ZCd!„ZDd"„ZEd#„ZFd$„ZGed%„ƒZHed&„ƒZIed'„ƒZJed(„ƒZKdS()iÿÿÿÿN(tforms(treverse(tformset_factorytmodelformset_factory(t_get_new_csrf_key(trender_to_response(tContexttRequestContext(tget_template_from_string(tEngine(tRequestFactory(t
ugettext_lazy(toverride_settingsi(t
only_uni_formtonly_bootstrap3tonly_bootstrap(tTestFormt	TestForm2t	TestForm3tCheckboxesTestFormt	TestForm4tCrispyTestModelt	TestForm5(tInlineCheckboxes(tPY2(t
FormHelper(	tLayouttFieldsett
MultiFieldtRowtColumntHTMLtButtonHoldertDivtSubmit(trender_crispy_formcCsutƒ}|jtdƒƒtdƒ}titƒd6|d6ƒ}t|_tj	t
ƒ|j|ƒWdQXdS(NsespañauP
        {% load crispy_forms_tags %}
        {% crispy form form_helper %}
    tformtform_helper(Rt
add_layoutRRRRtFalsetCRISPY_FAIL_SILENTLYtpytesttraisest	Exceptiontrender(tsettingsR%ttemplatetc((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyttest_invalid_unicode_characters*s	
		cspdtjf‡fd†ƒY‰trKtjtƒtˆƒƒWdQXn!tˆƒƒ}d|kslt‚dS(NtUnicodeFormcs/eZ‡fd†ZeƒZedƒe_RS(cs0tˆ|ƒj||Žtjƒ|jd<dS(Nscontraseña(tsupert__init__Rt	CharFieldtfields(tselftargstkwargs(R1(s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyR3?sucontraseña(t__name__t
__module__R3RthelperRtlayout((R1(s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyR1>s	sid="id_contraseña"(RtFormRR)R*R+R#tAssertionError(thtml((R1s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyttest_unicode_form_field=scCsŒdtfd„ƒY}|ƒ}|jd=tƒ}tdƒ|_tdƒ}ti|d6|d6ƒ}|j|ƒ}d|ksˆt‚dS(NtFormWithMetacBseZddd„ƒYZRS(tMetacBseZdZRS(temailt
first_namet	last_name(semails
first_names	last_name(R9R:R5(((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyRBPs((R9R:RB(((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyRAOsRCRDuP
        {% load crispy_forms_tags %}
        {% crispy form form_helper %}
    R$R%(	RR5RRR<RRR,R>(RAR$R%R.R/R?((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyt*test_meta_extra_fields_with_missing_fieldsNs	
		cCsutƒ}|jtdƒƒtdƒ}titƒd6|d6ƒ}t|_tj	t
ƒ|j|ƒWdQXdS(NttypouP
        {% load crispy_forms_tags %}
        {% crispy form form_helper %}
    R$R%(RR&RRRRR'R(R)R*R+R,(R-R%R.R/((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyttest_layout_unresolved_fieldes	
		cCsxtƒ}|jtddƒƒtdƒ}titƒd6|d6ƒ}t|_tj	t
ƒ|j|ƒWdQXdS(Nt
is_companyuP
        {% load crispy_forms_tags %}
        {% crispy form form_helper %}
    R$R%(RR&RRRRR'R(R)R*R+R,(R-R%R.R/((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyttest_double_rendered_fieldws	
		cCsšdtjfd„ƒY}|ƒ}tƒ}tdƒ}ti|d6|d6ƒ}|j|ƒ}|jdƒdks{t‚|jdƒd	ks–t‚dS(
NtExampleFormcBseZejƒZRS((R9R:RR4tcomment(((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyRK‹suw
        {% load crispy_forms_tags %}
        {{ form.as_ul }}
        {% crispy form2 %}
        {{ form.as_ul }}
    R$tform2sname="comment"isname="is_company"i(RR=RRRR,tcountR>(RKR$RMR.R/R?((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyttest_context_pollutionŠs			c
Cs’tƒ}|jttddddddddd	d
ƒtddtd
dddddƒtdƒtdƒddƒƒƒtdƒ}titƒd6|d6t	d6dd6ƒ}|j
|ƒ}d|ksÑt‚d|ksãt‚d|ksõt‚d|kst‚d|kst‚|jd ƒd!ks4t‚|j
d"krXd#|ksjt‚nd$|ksjt‚d|ks|t‚d%|ksŽt‚dS(&NuCompany Datau
is_companytcss_idtfieldset_company_datat	css_classt	fieldsetsttitletfieldset_titlet
test_fieldsett123u	User Datauemailu	password1u	password2t
row_passwordstrowss'<a href="#" id="testLink">test link</a>uK
                    {% if flag %}{{ message }}{% endif %}
                u
first_nameu	last_nameuP
        {% load crispy_forms_tags %}
        {% crispy form form_helper %}
    R$R%tflagsHello!tmessagesid="fieldset_company_data"sclass="fieldsetsstitle="fieldset_title"stest-fieldset="123"sid="row_passwords"s<labelituni_formsclass="formRow rows"sclass="row rows"ttestLink(RR&RRRRRRRtTrueR,R>RNtCRISPY_TEMPLATE_PACK(R-R%R.R/R?((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyt5test_layout_fieldset_row_html_with_unicode_fieldnamesžsT		
	

c
Cs¸tdƒ}tƒ}tƒ}|jttdddddddƒtd	d
ddƒƒƒ|jd=|jjdjd
=t	i|d6|d6ƒ}|j
|ƒ}d|ks´t‚dS(NuP
        {% load crispy_forms_tags %}
        {% crispy form form_helper %}
    uCompany DataRIRCt	password1t	password2RPtmultifield_infoRDREtcolumn_nameiiR$R%(RRRR&RRRR5R<RR,R>(R.R$R%R/R?((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyt+test_change_layout_dynamically_delete_fieldØs,			

c	Cs$ttddƒ}|ƒ}tƒ}d|_d|_d|_d|_ttddd	ƒt	d
ƒt
ddƒtd
ddƒƒ|_td|d|dit
ƒd6ƒ}tjd }d}|d-krY|jdƒdksæt‚|jdƒdkst‚d.|kod/knr;|jdƒdksVt‚qä|jdƒdksät‚n‹|jdƒdkstt‚|jdƒdkst‚|jdƒdksªt‚ttjdƒrä|jdƒdks×t‚|d7}n|jd ƒ|ksÿt‚|jd!ƒdkst‚|jd"ƒdks5t‚d|ksGt‚d#|ksYt‚d$|kskt‚d%tdƒ|ks‡t‚d&|ks™t‚d'|ks«t‚d(|ks½t‚|jd)ƒdksØt‚|jd*kr|jd+ƒdks t‚n|jd,ƒdks t‚dS(0NtextraitthisFormsetRockssformsets-that-rocktPOSTtsimpleActionsItem {{ forloop.counter }}RIRCs9{% if forloop.first %}Note for first form only{% endif %}RaRbtRDRER$R;tcontextt
csrf_tokeniiisHtype="hidden" name="form-TOTAL_FORMS" value="3" id="id_form-TOTAL_FORMS"sLtype="hidden" name="form-INITIAL_FORMS" value="0" id="id_form-INITIAL_FORMS"sBtype="hidden" name="form-MAX_NUM_FORMS" id="id_form-MAX_NUM_FORMS"sOtype="hidden" name="form-MAX_NUM_FORMS" value="1000" id="id_form-MAX_NUM_FORMS"sHid="id_form-TOTAL_FORMS" name="form-TOTAL_FORMS" type="hidden" value="3"sLid="id_form-INITIAL_FORMS" name="form-INITIAL_FORMS" type="hidden" value="0"sOid="id_form-MAX_NUM_FORMS" name="form-MAX_NUM_FORMS" type="hidden" value="1000"tMIN_NUM_FORM_COUNTsLid="id_form-MIN_NUM_FORMS" name="form-MIN_NUM_FORMS" type="hidden" value="0"thiddens<forms/<input type='hidden' name='csrfmiddlewaretoken's
method="post"sid="thisFormsetRocks"saction="%s"sItem 1sItem 2sItem 3sNote for first form onlyR\tformRowtrow(ii(ii(iii(RRRtform_idt
form_classtform_methodtform_actionRRRRR<R#RtdjangotVERSIONRNR>thasattrRtformsetsRR_(R-tTestFormSettformsetR;R?tdjango_versionthidden_count((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyttest_formset_layoutüs|							

cCs1ttdtddƒ}|dtjjƒƒ}tƒ}tdƒ|_td|d|ƒ}|j	dƒdksxt
‚|j	d	ƒdks“t
‚|j	d
ƒdks®t
‚tjd }|dkrU|j	dƒdksât
‚|j	d
ƒdksýt
‚d|kodknr7|j	dƒdksRt
‚q¦|j	dƒdks¦t
‚nQ|j	dƒdkspt
‚|j	dƒdks‹t
‚|j	dƒdks¦t
‚|j	dƒdksÁt
‚|j	dƒdksÜt
‚|j	dƒdks÷t
‚|j	dƒdkst
‚|j	dƒdks-t
‚dS(NR$RfitquerysetRCR;sid_form-0-idisid_form-1-idsid_form-2-idisHtype="hidden" name="form-TOTAL_FORMS" value="3" id="id_form-TOTAL_FORMS"sLtype="hidden" name="form-INITIAL_FORMS" value="0" id="id_form-INITIAL_FORMS"isBtype="hidden" name="form-MAX_NUM_FORMS" id="id_form-MAX_NUM_FORMS"sOtype="hidden" name="form-MAX_NUM_FORMS" value="1000" id="id_form-MAX_NUM_FORMS"sHid="id_form-TOTAL_FORMS" name="form-TOTAL_FORMS" type="hidden" value="3"sLid="id_form-INITIAL_FORMS" name="form-INITIAL_FORMS" type="hidden" value="0"sOid="id_form-MAX_NUM_FORMS" name="form-MAX_NUM_FORMS" type="hidden" value="1000"sname="form-0-email"sname="form-1-email"sname="form-2-email"sname="form-3-email"itpassword(ii(ii(iii(
RRRtobjectstnoneRRR<R#RNR>RuRv(tCrispyModelFormSetRzR;R?R{((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyttest_modelformset_layoutKsL	
cCs’tdƒ}tƒ}tƒ}tttdƒƒttdƒddƒƒ|_||_|j	t
i|d6ƒƒ}|jdƒdksŽt‚dS(NuP
        {% load crispy_forms_tags %}
        {% crispy form form.helper %}
    s	i18n textsi18n legendRDRER$i(
RRRRRt_RR<R;R,RRNR>(R.R$R%R?((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyt	test_i18nzs					cCsƒt|_t|_tdidd6ƒ}t|ƒ}d|ksFt‚|jdkr^d}nd}|j|ƒdkst‚dS(	Ntdataiètpks
value="1,000"R\s/> 1000<s>1000i(R^tUSE_L10NtUSE_THOUSAND_SEPARATORRR#R>R_RN(R-R$R?t
label_text((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyt	test_l10ns			cCs=tƒ}|jjjdddddddgks9t‚dS(NRIRCRaRbRDREtdatetime_field(RR;R<R5R>(t	test_form((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyttest_default_layout¢s	cCs+tƒ}|jjjdgks't‚dS(NRC(RR;R<R5R>(R((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyttest_default_layout_twoªs	cCs[tƒ}tƒ|_tdƒ|j_t|ƒ}d|ksEt‚d|ksWt‚dS(NRCR(RRR;RR<R#R>(RR?((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyt"test_modelform_layout_without_meta¯s	cCshtƒ}tjƒ|jd_tƒ|_tdtdƒƒ|j_	t
|ƒ}d|ksdt‚dS(NRCs0<span>first span</span> <span>second span</span>(RRtTextareaR5twidgetRR;RRR<R#R>(RR?((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyt2test_specialspaceless_not_screwing_intended_spaces¹s	cCs{tƒ}|jtttdddddƒƒtddddd	ƒttd
d
ddƒƒtdd
ddddƒƒƒtdƒ}t	it
ƒd6|d6ƒ}|j|ƒ}d|ksÃt‚d|ksÕt‚d|ksçt‚d|ksùt‚d|kst‚d|kst‚d|ks/t‚d|ksAt‚d|ksSt‚d|kset‚d|kswt‚dS(NsSome company dataRIRCRPRcRDRdRRtcolumnstSavesbutton whiteRaRbs
custom-divt
customdivsu\
            {% load crispy_forms_tags %}
            {% crispy form form_helper %}
        R$R%t
multiFieldt
formColumnsid="multifield_info"sid="column_name"sclass="formColumn columns"sclass="buttonHolder">sinput type="submit"sname="Save"sid="custom-div"sclass="customdivs"RE(
RR&RRRR R"R!RRRR,R>(R%R.R/R?((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyttest_layout_compositionÆsD		
	cCs9tƒ}|jttddddddddd	ƒtd
dddd
dƒttddd
dddddƒtddƒƒtddddd
ddd	ƒƒƒtdƒ}t	it
ƒd6|d6dd 6ƒ}|j|ƒ}d!|ksñt‚d"|kst‚d#|kst‚d$|ks't‚d%|ks9t‚d&|ksKt‚d'|ks]t‚d(|ksot‚d)|kst‚d|ks“t‚d*|ks¥t‚d+|ks·t‚d,|ksÉt‚d-|ksÛt‚d.|ksít‚d/|ksÿt‚d0|kst‚d1|ks#t‚d2|ks5t‚dS(3NsSome company dataRIRCRPRcRTtmultifield_titletmultifield_testRWRDRERdRRR”sSave the worlds{{ value_var }}sbutton whitetdata_idttestt	data_nametstores
Store resultsRaRbs
custom-divR–ttest_markupu\
            {% load crispy_forms_tags %}
            {% crispy form form_helper %}
        R$R%R•t	value_varR—R˜sid="multifield_info"stitle="multifield_title"smultifield-test="123"sid="column_name"sclass="formColumn columns"sclass="buttonHolder">sinput type="submit"sdata-id="test"sdata-name="test"sname="save-the-world"svalue="Save"sname="store"svalue="Store results"sid="custom-div"sclass="customdivs"stest-markup="123"(
RR&RRRR R"R!RRRR,R>(R%R.R/R?((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyt<test_second_layout_multifield_column_buttonholder_submit_divøs\	
	$cCsÔtƒ}tƒ|_tdtdƒdƒ|j_tƒ}|jdƒ}t|i|d6ƒ}t	d|ƒ}|j
dkr |jjdƒd	ksÐt
‚n0|j
d
krÐ|jjdƒd	ksÐt
‚ndS(Nt
checkboxestalphacheckboxestnumeric_multiple_checkboxest/R$scrispy_render_template.htmlt	bootstrapscheckbox inlineit
bootstrap3scheckbox-inline(RRR;RRR<R
tgetRRR_tcontentRNR>(R-R$trequest_factorytrequestRktresponse((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyt test_keepcontext_context_manager4s			!cCs÷tƒ}tƒ|_d|j_d|j_tdddƒ|j_t|ƒ}|jdƒdkslt	‚|jdƒd	ks‡t	‚|jd
ƒdks¢t	‚|jdƒdks½t	‚|jdƒdksØt	‚|jd
ƒd	ksót	‚dS(Nsform-inlines#bootstrap3/layout/inline_field.htmlRCRaREsclass="form-inline"isclass="form-group"is$<label for="id_email" class="sr-onlys$id="div_id_email" class="form-group"splaceholder="email"s</label> <input(
RRR;Rrtfield_templateRR<R#RNR>(R$R?((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyttest_form_inlineLs	(LRuRtdjango.core.urlresolversRtdjango.forms.modelsRRtdjango.middleware.csrfRtdjango.shortcutsRtdjango.templateRRR)tdjango.template.loaderRtImportErrorR	tfrom_stringtdjango.testR
tdjango.utils.translationRR„Rtdjango.test.utilstconftestR
RRRRRRRRRtcrispy_forms.bootstrapRtcrispy_forms.compatibilityRtcrispy_forms.helperRtcrispy_forms.layoutRRRRRRR R!R"tcrispy_forms.utilsR#R0R@RFRHRJROR`ReR}RƒR…R‹RŽRRR“R™R¢R®R°(((s[/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout.pyt<module>sZ

4@							:	$	O	/					
	
2<