Ñò ;óJc@s¬ddkZdeifd„ƒYZdeifd„ƒYZd„Zdeifd„ƒYZd eifd „ƒYZd fd „ƒYZd fd„ƒYZd„Z dS(iÿÿÿÿNtTestFormPlugincBs°eZd„Zddddd„Zddedd„Zd„Zd„Zd„Z d„Z d „Z d „Z d „Z d „Zd „Zd„Zd„Zd„Zd„ZRS(cCsddkl}|S(Niÿÿÿÿ(t FormPlugin(trepoze.who.plugins.formR(tselfR((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt_getTargetClassst __do_logintcookiecCs|iƒ||||ƒ}|S(N(R(Rt login_form_qstrememberer_nametformbodyt formcallabletplugin((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt_makeOne s c Cs!ddkl}g}|o|id|fƒn|o|id|fƒn|o|id|fƒnt|ƒ\}}hdd6dd6} t| ƒ} h dd 6||ƒd 6d d 6d d6dd6|d6t|ƒd6dd6h| d6d6dd6dd6} |od| d(RR:R R(R4R?((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt"test_identify_success_with_max_age\s   cCs_|iƒ}|iƒ}h}|i||ƒ}|i|dƒ|i|ddi|ƒdS(Nsrepoze.who.pluginsR(R R)trememberR2R3t remembered(RR R(tidentityR4((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt test_rememberhs  cCs_|iƒ}|iƒ}h}|i||ƒ}|i|dƒ|i|ddi|ƒdS(Nsrepoze.who.pluginsR(R R)tforgetR2R3t forgotten(RR R(RER4((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt test_forgetqs  cCsçddkl}|iƒ}|iƒ}|i|dggƒ}tƒ}|||ƒ}|idi|ƒ|ƒ|it|i ƒdƒt t|ƒƒ}|i|i dd|fƒ|i|i dd ƒ|i|i d ƒdS( Niÿÿÿÿ(t _DEFAULT_FORMs401 UnauthorizedRiisContent-Lengthis Content-Types text/htmls200 OK(s Content-Types text/html( RRJR R)t challengetDummyStartResponseR2tjoinR!theaderststrtstatus(RRJR R(R?tsrR4tcl((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyttest_challenge_defaultform{s   c Cs7ddk}|iitƒ}|ii|dƒ}|ii|dƒ}t|ƒiƒ}|id|ƒ}|iƒ}|i |dggƒ}t ƒ} ||| ƒ} |i di| ƒ|ƒ|i t | i ƒdƒtt |ƒƒ} |i | i dd | fƒ|i | i d dƒ|i | id ƒdS(Niÿÿÿÿtfixturess form.htmlR s401 UnauthorizedRiisContent-Lengthis Content-Types text/htmls200 OK(s Content-Types text/html(tostpathtdirnamet__file__RMtopentreadR R)RKRLR2R!RNRORP( RRUthereRTtformR R R(R?RQR4RR((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyttest_challenge_customform‰s    cCsnd„}|id|ƒ}|iƒ}|i|dggƒ}tƒ}|||ƒ}|i|dgƒdS(NcSsdS(NR ((R(((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt _formcallableœsR s401 Unauthorized(R R)RKRLR2(RR^R R(R?RQR4((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyttest_challenge_formcallable›s   cCsÄ|iƒ}|iƒ}|i|dd gdgƒ}tƒ}|||ƒt|iƒ}|it|ƒdƒ|i|ddƒ|i|ddƒ|i|d dƒ|i|id ƒdS(Ns401 UnauthorizedtLocationshttp://foo/bars Set-Cookiesa=123iiiis content-typestext/plain; charset=utf8s 302 Found(R`shttp://foo/bar(s Set-Cookiesa=123(R`shttp://foo/bar(s Set-Cookiesa=123(s content-typestext/plain; charset=utf8( R R)RKRLtsortedRNR2R!RP(RR R(R?RQRN((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyttest_challenge_with_location¥s        N(t__name__t __module__RR3R tFalseR)R0R5R7R8R9R@RBRFRIRSR]R_Rb(((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyRs(            tTest_make_plugincBs5eZd„Zd„Zd„Zd„Zd„ZRS(cOsddkl}|||ŽS(Niÿÿÿÿ(t make_plugin(RRg(RtargstkwRg((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt_callFUT¸scCs|it|iƒdS(N(t assertRaisest ValueErrorRj(R((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyttest_no_rememberer_name_raises¼scCs¿ddk}|iitƒ}|ii|dƒ}|ii|dƒ}t|ƒiƒ}|idd|ƒ}|i|i dƒ|i|i dƒ|i|i |ƒ|i|i dƒdS(NiÿÿÿÿRTs form.htmlt__loginR(RURVRWRXRMRYRZRjR2RRR R R3(RRUR[RTR\R R ((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyttest_with_form¿s cCsb|iddƒ}|i|idƒ|i|idƒ|i|idƒ|i|idƒdS(NRnR(RjR2RRR R3R (RR ((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyttest_default_formËs cCs5d}|iddd|ƒ}|i|itƒdS(Ns6repoze.who.plugins.tests.test_form:sample_formcallableRnRR (RjR2R tsample_formcallable(RtdottedR ((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyttest_with_formcallableÒs (RcRdRjRmRoRpRs(((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyRf¶s    cCs hdd6S(Ntbartfoo((R(((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyRqÙstTestRedirectingFormPlugincBsÝeZd„Zdddddd„Zddddddd„Zd „Zd „Zd „Zd „Z d „Z d„Z d„Z d„Z d„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(cCsddkl}|S(Niÿÿÿÿ(tRedirectingFormPlugin(RRw(RRw((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyRßsshttp://example.com/login.htmls/login_handlers/logout_handlerRtreasoncCs"|iƒ|||||ƒ}|S(N(R(Rtlogin_form_urltlogin_handler_pathtlogout_handler_pathRt reason_paramR ((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyR ãs t/c Cs;ddkl}g}|o|id|fƒn|o|id|fƒn|o|id|fƒn|o|id|fƒn|djo$hdd6dd6} t| ƒ}nt|ƒ\} } h dd 6|| ƒd 6d d 6dd6dd6| d6t| ƒd6dd6h|d6d6dd6|d6} | S(Niÿÿÿÿ(R RRt came_fromRRiis wsgi.versions wsgi.inputRswsgi.url_schemeswww.example.comRt80RRRRRRsrepoze.who.pluginss default=1RR(ii(R RR3R RR!( RRRR~t path_infoR'RR R#R&R$R%R(((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyR)ís4     cCsZddkl}ddkl}ddkl}|iƒ}|||ƒ|||ƒdS(Niÿÿÿÿ(R*(R+(R,(R-R*R.R+R,R(RR*R+R,R/((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyR0 s   cCsW|iƒ}|iddƒ}|i|ƒ}|i|dƒ|i|idƒƒdS(NR€s/not_login_handlersrepoze.who.application(R R)R1R2R3tfailIftget(RR R(R4((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyttest_identify_pathinfo_misss  c CsÊ|iƒ}|iddddddddƒ}|i|ƒ}|i|hdd6dd6ƒ|d}|it|iƒd ƒ|id \}}|i|d ƒ|i|dƒ|i|id ƒdS( NR€s/login_handlerRRRR~shttp://example.comsrepoze.who.applicationiiR>i.(R R)R1R2R!RNtcode(RR R(R4R?tnametvalue((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyttest_identify_via_login_handlers   c Cs×|iƒ}|idddddddddd ƒ}|i|ƒ}|i|hdd6dd6d d6ƒ|d }|it|iƒd ƒ|id \}}|i|d ƒ|i|dƒ|i|idƒdS(NR€s/login_handlerRRRR~shttp://example.comRRAsrepoze.who.applicationiiR>i.(R R)R1R2R!RNR„(RR R(R4R?R…R†((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt'test_identify_via_login_handler_max_age)s    cCsª|iƒ}|iddƒ}|i|ƒ}|i|dƒ|d}|it|iƒdƒ|id\}}|i|dƒ|i|dƒ|i|idƒdS( NR€s/login_handlersrepoze.who.applicationiiR>R}i.(R R)R1R2R3R!RNR„(RR R(R4R?R…R†((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt0test_identify_via_login_handler_no_username_pass:s  cCsÄ|iƒ}|iddddddƒ}|i|ƒ}|i|hdd6dd6ƒ|d}|it|iƒdƒ|id\}}|i|d ƒ|i|d ƒ|i|id ƒdS( NR€s/login_handlerRRRsrepoze.who.applicationiiR>R}i.(R R)R1R2R!RNR„(RR R(R4R?R…R†((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt<test_identify_via_login_handler_no_came_from_no_http_refererFs   cCsÎ|iƒ}|iddddddƒ}d|d<|i|ƒ}|i|hdd6dd6ƒ|d}|it|iƒd ƒ|id \}}|i|d ƒ|i|dƒ|i|id ƒdS( NR€s/login_handlerRRRshttp://foo.bart HTTP_REFERERsrepoze.who.applicationiiR>i.(R R)R1R2R!RNR„(RR R(R4R?R…R†((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt,test_identify_via_login_handler_no_came_fromTs    c Cs|iƒ}|iddddddddƒ}|i|ƒ}|i|dƒ|d}|it|iƒd ƒ|i|id ƒ|i|ddƒdS( NR€s/logout_handlerRRRR~shttp://example.comsrepoze.who.applicationii‘(R R)R1R2R3R!RNR„(RR R(R4R?((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt test_identify_via_logout_handlercs   cCs—|iƒ}|iddddddƒ}|i|ƒ}|i|dƒ|d}|it|iƒdƒ|i|idƒ|i|d d ƒdS( NR€s/logout_handlerRRRsrepoze.who.applicationii‘R~R}(R R)R1R2R3R!RNR„(RR R(R4R?((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt=test_identify_via_logout_handler_no_came_from_no_http_refererps   cCs¡|iƒ}|iddddddƒ}d|d<|i|ƒ}|i|dƒ|d}|it|iƒd ƒ|i|id ƒ|i|d dƒdS( NR€s/logout_handlerRRRshttp://example.com/refererR‹srepoze.who.applicationii‘R~(R R)R1R2R3R!RNR„(RR R(R4R?((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt-test_identify_via_logout_handler_no_came_from|s    cCs_|iƒ}|iƒ}h}|i||ƒ}|i|dƒ|i|ddi|ƒdS(Nsrepoze.who.pluginsR(R R)RCR2R3RD(RR R(RER4((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyRF‰s  cCs_|iƒ}|iƒ}h}|i||ƒ}|i|dƒ|i|ddi|ƒdS(Nsrepoze.who.pluginsR(R R)RGR2R3RH(RR R(RER4((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyRI’s  cCs$|iƒ}|iƒ}|i|ddgdgƒ}tƒ}di|||ƒƒ}|i|idƒƒ|it|i ƒdƒ|i|i ddd ƒ|i dd }d dk }d dk }|i |ƒ} |i | d ƒ} |it| ƒd ƒ| d\} } |i| dd ƒ|i| d dƒ|i| ddƒ|i| ddƒ|i| dƒ|i| dƒ|i } |it| ƒdƒ|i|i d ddƒ|i|i d d dƒ|i|i dddƒ|i|i dd dƒ|i|i dƒdS(Ns401 UnauthorizedR?t1RGRs 302 FoundiiR`iiÿÿÿÿiRs example.comis /login.htmlR~s!http://www.example.com/?default=1s content-typestext/plain; charset=utf8(sappR(sforgetR(R R)RKRLRMR<t startswithR2R!RNturlparsetcgit parse_qslRP(RR R(R?RQR4turlR’R“tpartst parts_qslt came_from_keytcame_from_valueRN((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyttest_challengeœs:       c Cs|iƒ}|iƒ}d|d<|i|ddgdgƒ}tƒ}di|||ƒƒ}|i|idƒƒ|it|i ƒd ƒ|i|i d d d ƒ|i d d }d dk }d dk }|i |ƒ} |i | dƒ} |it| ƒd ƒ| d \} } |i| d dƒ|i| d dƒ|i| ddƒ|i| d dƒ|i| dƒ|i| dƒdS(Nshttp://example.com/came_fromR~s401 UnauthorizedR?RRGRs 302 FoundiiR`iiÿÿÿÿiRs example.comis /login.html(sappR(sforgetR( R R)RKRLRMR<R‘R2R!RNR’R“R”( RR R(R?RQR4R•R’R“R–R—R˜R™((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt#test_challenge_came_from_in_environ»s.       cCsÊ|iƒ}|iƒ}d|d<|i|ddgdgƒ}tƒ}di|||ƒƒ}|i|id ƒƒ|it|i ƒd ƒ|i|i d d d ƒ|i d d }ddk }ddk }|i |ƒ} |i | dƒ} |it| ƒdƒ| i ƒ| d \} } | d \} }|i| d dƒ|i| d dƒ|i| ddƒ|i| d dƒ|i| dƒ|i| dƒ|i| dƒ|i|dƒdS(Nshttp://example.com/came_fromR~s401 UnauthorizedsX-Authorization-Failure-Reasons you are uglyRGRRs 302 FoundiiR`iiÿÿÿÿiiRs example.coms /login.htmlRx(sX-Authorization-Failure-Reasons you are ugly(sforgetR(R R)RKRLRMR<R‘R2R!RNR’R“R”tsort(RR R(R?RQR4R•R’R“R–R—R˜R™t reason_keyt reason_value((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt!test_challenge_with_reason_headerÔs:        cCsÐ|iddƒ}|iƒ}d|d<|i|ddgdgƒ}tƒ}d i|||ƒƒ}|i|id ƒƒ|it|i ƒd ƒ|i|i d d dƒ|i d d}ddk }ddk }|i |ƒ} |i | dƒ} |it| ƒdƒ| i ƒ| d \} } | d\} }|i| d dƒ|i| ddƒ|i| ddƒ|i| d d ƒ|i| dƒ|i|dƒ|i| dƒ|i| dƒdS(NR|t auth_failureshttp://example.com/came_fromR~s401 UnauthorizedsX-Authorization-Failure-Reasons you are uglyRGRRs 302 FoundiiR`iiÿÿÿÿiiRs example.coms /login.html(sX-Authorization-Failure-Reasons you are ugly(sforgetR(R R)RKRLRMR<R‘R2R!RNR’R“R”Rœ(RR R(R?RQR4R•R’R“R–R—RRžR˜R™((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt2test_challenge_with_reason_and_custom_reason_paramós:       cCsà|iƒ}|iƒ}|i|dd d dggƒ}tƒ}di|||ƒƒ}|i|idƒƒ|i|id d dƒ|i|id d dƒ|i|id d dƒ|i|id d dƒdS(Ns401 UnauthorizedR?Rs set-cookietatbRs 302 Foundiii(sappR(s set-cookieR¢(s set-cookieR£( R R)RKRLRMR<R‘R2RN(RR R(R?RQR4((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt&test_challenge_with_setcookie_from_apps     N(RcRdRR R3R)R0RƒR‡RˆR‰RŠRŒRRŽRRFRIRšR›RŸR¡R¤(((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyRvÝs2             tTest_make_redirecting_plugincBs>eZd„Zd„Zd„Zd„Zd„Zd„ZRS(cOsddkl}|||ŽS(Niÿÿÿÿ(tmake_redirecting_plugin(RR¦(RRhRiR¦((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyRj$scCs|it|idƒdS(N(RkRlRjR3(R((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt%test_factory_no_login_form_url_raises(scCs|it|iddƒdS(Ns /go_there(RkRlRjR3(R((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt)test_factory_no_login_handler_path_raises+scCs |it|idddƒdS(Ns /go_theres /logged_in(RkRlRjR3(R((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt*test_factory_no_logout_handler_path_raises.scCs#|it|iddddƒdS(Ns /go_theres /logged_ins /logged_out(RkRlRjR3(R((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt&test_factory_no_rememberer_name_raises2scCsh|iddddƒ}|i|idƒ|i|idƒ|i|idƒ|i|idƒdS(Ns /go_theres /logged_ins /logged_outt rememberer(RjR2RyRzR{R(RR ((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyttest_factory_ok6s  (RcRdRjR§R¨R©RªR¬(((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyR¥"s      R cBsDeZeZeZddddd„Zd„Zd„Zd„Z RS(cCs(||_||_||_||_dS(N(R&tremember_headerstforget_headerst replace_app(RR&R­R®R¯((sF/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_form.pyt__init__Ds   cCs"|io|i|ds ³# ÿF