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_objects.pyc

ó
I0ÔUc@s‘ddlmZddlmZyddlmZWn-ek
rcddlmZeƒjZnXddl	m
Zddl	mZm
Z
ddlmZdd	lmZmZdd
lmZmZmZmZmZmZmZmZmZmZmZmZddlm Z ddl!m"Z"m#Z#m$Z$m%Z%dd
l&m'Z'd„Z(d„Z)d„Z*d„Z+d„Z,ede-fd„ƒYƒZ.dS(iÿÿÿÿ(tforms(tContext(tget_template_from_string(tEngine(tugettext(tactivatet
deactivatei(tonly_bootstrap(tCheckboxesTestFormtTestForm(tPrependedAppendedTexttAppendedTextt
PrependedTexttInlineRadiostTabt	TabHoldertAccordionGroupt	AccordiontAlerttInlineCheckboxestFieldWithButtonstStrictButton(t
FormHelper(tLayouttHTMLtFieldtMultiWidgetField(trender_crispy_formcCstdƒ}tƒ}tƒ|_ttddidd6idd6dd6d	d
6fƒƒ|j_ti|d6ƒ}|j|ƒ}|j	dƒd
ksžt
‚|j	dƒd
ks¹t
‚|j	dƒd
ksÔt
‚|j	dƒd
ksït
‚|j	dƒd
ks
t
‚dS(NuD
        {% load crispy_forms_tags %}
        {% crispy form %}
    tdatetime_fieldtattrsttest_dateinputtrelttest_timeinputswidth: 30px;tstylethiddenttypetformsclass="dateinputisrel="test_dateinput"srel="test_timeinput"sstyle="width: 30px;"s
type="hidden"(RR	RthelperRRtlayoutRtrendertcounttAssertionError(ttemplatet	test_formtcthtml((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyttest_multiwidget_fields 		
*cCsàtdƒ}tƒ}tƒ|_ttdddddƒtdƒƒ|j_ti|d6ƒ}|j|ƒ}|j	d	ƒd
ks‹t
‚|j	dƒd
ks¦t
‚|j	dƒd
ksÁt
‚|j	d
ƒd
ksÜt
‚dS(NuI
        {% load crispy_forms_tags %}
        {% crispy test_form %}
    temailR#R"t	data_testiRR+sdata-test="12"isname="email"sclass="dateinputsclass="timeinput(RR	RR%RRR&RR'R(R)(R*R+R,R-((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyttest_field_type_hidden:s		
cCstƒ}tƒ|_ttdddƒƒ|j_t|ƒ}|jdkrl|jdƒdks™t	‚n-|jdkr™|jdƒdks™t	‚ndS(	NR/t
wrapper_classttestingt	bootstrapsclass="control-group testing"it
bootstrap3sclass="form-group testing"(
R	RR%RRR&RtCRISPY_TEMPLATE_PACKR(R)(tsettingsR$R-((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyttest_field_wrapper_classSs	cCs²tƒ}tƒ|_ttdƒƒ|j_t|ƒ}|jdkrf|jdƒdks®t	‚nH|jdkr“|jdƒdks®t	‚n|jdƒdks®t	‚dS(Nsz
            if (a==b){
                // some comment
                a+1;
                foo();
            }
        tuni_forms
iR4ii(
R	RR%RRR&RR6R(R)(R7R+R-((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyttest_html_with_carriage_returns_s	cCsftdƒtƒ}tƒ|_tttdƒƒƒ|j_t|ƒ}d|ks[t	‚t
ƒdS(NtessEnter a valid value.uIntroduzca un valor correcto(RR	RR%RRt_R&RR)R(R$R-((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyt	test_i18nus
	tTestBootstrapLayoutObjectscBs}eZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„Zd„Z
d„ZRS(
cCsÑdtjfd„ƒY}dtjfd„ƒY}tƒ}|ƒ|jd_tƒ|_tdƒ|j_	t
|ƒ}d|ksŠt‚|ƒ|jd_tdƒ|j_	t
|ƒ}d|ksÍt‚dS(	NtCustomRadioSelectcBseZRS((t__name__t
__module__(((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyR?…stCustomCheckboxSelectMultiplecBseZRS((R@RA(((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyRBˆst
inline_radioss
class="radio"t
checkboxessclass="checkbox"(RtRadioSelecttCheckboxSelectMultipleRtfieldstwidgetRR%RR&RR)(tselfR?RBR$R-((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyttest_custom_django_widget„s	cCsWtƒ}tƒ|_ttdddƒtddƒtddƒƒ|j_t|ƒ}|j	dkrÕ|j
d	ƒd
kst‚|j
dƒd
ksœt‚|j
dƒd
ks·t‚|j
d
ƒd
ksÕt‚n|j	dkrS|j
dƒd
ksÿt‚|j
dƒd
kst‚|j
dƒd
ks5t‚|j
dƒd
ksSt‚ndS(NR/t@s	gmail.comt	password1t#t	password2t$R4s<span class="add-on">@</span>is%<span class="add-on">gmail.com</span>s<span class="add-on">#</span>s<span class="add-on">$</span>R5s(<span class="input-group-addon">@</span>s0<span class="input-group-addon">gmail.com</span>s(<span class="input-group-addon">#</span>s(<span class="input-group-addon">$</span>(R	RR%RR
RRR&RR6R(R)(RIR7R+R-((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyttest_prepended_appended_textšs"	cCs—tƒ}tƒ|_ttdƒƒ|j_t|ƒ}|jdkrf|jdƒdks“t	‚n-|jdkr“|jdƒdks“t	‚ndS(NRCR4s
radio inline"iR5s
radio-inline"(
RRR%RR
R&RR6R(R)(RIR7R+R-((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyttest_inline_radios±s	cCstƒ}tƒ|_tttddƒtdddƒƒƒ|j_t|ƒ}|jdkr´|j	dƒdks{t
‚|j	d	ƒd
ks–t
‚|j	dƒd
kst
‚nQ|j	dƒd
ksÏt
‚|j	d
ƒdksêt
‚|j	dƒd
kst
‚|j	dƒdks t
‚|j	dƒdks;t
‚|j	dƒdksVt
‚|j	dƒdksqt
‚|j	dƒdksŒt
‚dS(Ntonet
first_namettwoRLRNR4s<div class="accordion"is<div class="accordion-group">is<div class="accordion-heading">s <div class="panel panel-default"s<div class="panel-group"s<div class="panel-heading">s
<div id="one"s
<div id="two"sname="first_name"sname="password1"sname="password2"(R	RR%RRRR&RR6R(R)(RIR7R+R-((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyt!test_accordion_and_accordiongroup¾s0	cCsÕtƒ}tƒ|_tttddƒƒƒ|j_t|ƒ}|jdkrZd}nd}|j	d|ƒdkst
‚tttdddtƒƒƒ|j_t|ƒ}|j	d|ƒd	ksÑt
‚dS(
NRRRSR4saccordion-bodyspanel-collapses$<div id="one" class="%s collapse in"itactivei(R	RR%RRRR&RR6R(R)tFalse(RIR7R+R-taccordion_class((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyt(test_accordion_active_false_not_renderedßs(		cCs‘tƒ}tƒ|_ttddƒƒ|j_t|ƒ}|jdƒdksWt‚|jdƒdksrt‚|jdƒdkst‚dS(Ntcontents
Testing...s<div class="alert"is#<button type="button" class="close"(	R	RR%RRR&RR(R)(RIR+R-((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyt
test_alerts	cCs|tƒ}tƒ|_ttdddtƒƒ|j_t|ƒ}|jdƒdks]t	‚|jdƒdksxt	‚dS(NRZs
Testing...tblocks<div class="alert alert-block"i(
R	RR%RRtTrueR&RR(R)(RIR+R-((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyttest_alert_blocks	c	CsTtƒ}tƒ|_tttddddddƒtddd	ƒƒƒ|j_t|ƒ}|jd
ƒdksxt	‚|jdƒdks“t	‚|jd
ƒdks®t	‚|jdƒdksÉt	‚|jdƒdksät	‚|jdƒdksÿt	‚|jdƒdkst	‚|jdƒdks5t	‚|jdƒdksPt	‚dS(NRRRStcss_idscustom-namet	css_classsfirst-tab-classRTRLRNsQ<li class="tab-pane active"><a href="#custom-name" data-toggle="tab">One</a></li>is'class="tab-pane first-tab-class active"s<li class="tab-paneistab-paneis<div id="custom-name"s
<div id="two"sname="first_name"sname="password1"sname="password2"(
R	RR%RRRR&RR(R)(RIR+R-((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyttest_tab_and_tab_holders.	cCsºdtjfd„ƒY}|ƒ}t|ƒ}|ƒ}t|ƒ}|jdƒdks^t‚|didd6ƒ}t|ƒ}|jdƒdks›t‚|jd	ƒd
ks¶t‚dS(NR	cBs_eZejdeƒZejdeƒZeƒZ	e
eeddƒeddƒƒƒe	_
RS(trequiredRRtval1RTtval2(R@RARt	CharFieldRWRcR]RdRR%RRRR&(((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyR	=s	sclass="tab-pane active active"itdatatfooRcs)<div id="one" 
    class="tab-pane actives)<div id="two" 
    class="tab-pane activei(RtFormRR(R)(RIR	R+R-((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyttest_tab_helper_reuse9s		cCsqtƒ}idd6|jdj_idd6|jdj_t|ƒ}d|ks[t‚d|ksmt‚dS(NtfirsttclassRCtsecondRDs
class="first"sclass="second"(RRGRHRRR)(RIR$R-((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyttest_radio_attrsZs	c
Cs3tƒ}tƒ|_tttdddƒtdddƒtdddƒtd	d
ddd
ddƒddddƒƒ|j_t|ƒ}d}|j	dkr¨d}n|j
d|ƒdksÇt‚|j
dƒdksât‚|j
dƒdksýt‚|j
dƒdkst‚|j
dƒdks3t‚|j
dƒdksNt‚|j
dƒdksit‚|j
dƒdks„t‚|j
dƒdksŸt‚|j
dƒdksºt‚|j
dƒdksÕt‚|j	d kr|j
d!ƒdks/t‚n-|j	dkr/|j
d"ƒdks/t‚ndS(#NRLR`tspan4sGo!R_s	go-buttonsNo!textratTestR#tsubmittnametwhatevertvaluet	somethingtautocompletetoffs
control-groupR5s
form-groupsclass="%s extra"isautocomplete="off"sclass="span4sid="go-button"sclass="btn"isclass="btn extra"s
type="submit"sname="whatever"svalue="something"R4sclass="input-append"sclass="input-group-btn(R	RR%RRRRR&RR6R(R)(RIR7R$R-tform_group_class((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyttest_field_with_buttonsbs:		cCsåtƒ}x'|jD]}tjƒ|j|_qWtƒ|_ttddƒt	ddƒt
ddƒtdƒtdƒƒ|j_
t|ƒ}|jdƒd	ks«t‚|jd
ƒd	ksÆt‚|jdƒdksát‚dS(
NRLRgRNtbarR/RSt	last_names<inputis
type="hidden"s<labeli(R	RGRtHiddenInputRHRR%RRRR
RR
R&RR(R)(RIR$tfieldR-((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyttest_hidden_fields†s		cCsùtƒ}t|ƒ}|jdƒdks0t‚t|ƒ|_|jdjtdtƒt|ƒ}|j	dkr­|jdƒdkst‚|jdƒdksõt‚nH|j	d	krõ|jd
ƒdks×t‚|jdƒdksõt‚ndS(
Nschecked="checked"iitinlineR4scheckbox inline"isinline"R5scheckbox-inline"s
inline="True"i(
RRR(R)RR%twrapRR]R6(RIR7R+R-((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyttest_multiplecheckboxes™s	(R@RARJRPRQRURYR[R^RaRiRmRyR~R(((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyR>s			
	!	%				!		$	N(/tdjangoRtdjango.templateRtdjango.template.loaderRtImportErrorRtfrom_stringtdjango.utils.translationRR<RRtconftestRRR	tcrispy_forms.bootstrapR
RRR
RRRRRRRRtcrispy_forms.helperRtcrispy_forms.layoutRRRRtcrispy_forms.utilsRR.R1R8R:R=tobjectR>(((sc/Users/carlton/Documents/Django-Stack/django-crispy-forms/crispy_forms/tests/test_layout_objects.pyt<module>s*
R"