Ñò ËAóJc@s2ddkZdeifd„ƒYZd„ZdS(iÿÿÿÿNtTestAuthTktCookiePlugincBsyeZd)Zd)Zd„Zd„Zd„Zd)d„Zd„Z ddgdde d)d „Z d „Z d „Z d „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z!d „Z"d!„Z#d"„Z$d#„Z%d$„Z&d%„Z'd&„Z(d'„Z)d(„Z*RS(*cCsdS(N((tself((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pytsetUpscCsX|idj o ddk}|i|iƒn|idj o|i|iƒndS(Niÿÿÿÿ(ttempdirtNonetshutiltrmtreet _now_testingt_setNowTesting(RR((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyttearDown s  cCsddkl}|S(Niÿÿÿÿ(tAuthTktCookiePlugin(trepoze.who.plugins.auth_tktR (RR ((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyt_getTargetClassscCsChdd6}|dj o|i|ƒnd|d|idƒ}|iƒ}|i|ƒ}|i|dƒdS(NR(RRtidentifyt assertEqualR(RRRtresult((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyttest_identify_nocookie;s cCsû|iddtƒ}|iddƒ}|ihd|d6ƒ}|i|ƒ}|it|ƒdƒ|i|dd gƒ|i|d d ƒ|i|d d ƒ|id |jƒ|i|dd gƒ|i|dd ƒ|i|ddƒdS(NRt include_ipR#s1.1.1.1s auth_tkt=%st HTTP_COOKIEiRtsrepoze.who.useridRRt timestamptREMOTE_USER_TOKENStREMOTE_USER_DATAt AUTH_TYPEtcookie(RtTrueR%RR/R0tlent failUnless(RRtvalRR1((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyt$test_identify_good_cookie_include_ipAscCsõ|iddtƒ}|iƒ}|ihd|d6ƒ}|i|ƒ}|it|ƒdƒ|i|ddgƒ|i|dd ƒ|i|d d ƒ|id |jƒ|i|d dgƒ|i|d d ƒ|i|ddƒdS(NRR3s auth_tkt=%sR4iRR5srepoze.who.useridRRR6R7R8R9R:(RtFalseR%RR/R0R<R=(RRR>RR1((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyt)test_identify_good_cookie_dont_include_ipOs cCs|iddtƒ}|iddddƒ}|ihd|d6ƒ}|i|ƒ}|it|ƒd ƒ|i|d d gƒ|i|d d ƒ|i|ddƒ|id|jƒ|i|dd gƒ|i|ddƒ|i|ddƒdS(NRR3Rt1Rsuserid_type:ints auth_tkt=%sR4iRR5srepoze.who.useridiR6R7R8R9R:(RR@R%RR/R0R<R=(RRR>RR1((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyt(test_identify_good_cookie_int_useridtype]scCs|iddtƒ}|iddddƒ}|ihd|d6ƒ}|i|ƒ}|it|ƒdƒ|i|d d gƒ|i|d dƒ|i|ddƒ|id |jƒ|i|d d gƒ|i|ddƒ|i|ddƒdS(NRR3RRsuserid_type:unknowns auth_tkt=%sR4iRR5srepoze.who.useridR6R7R8R9R:(RR@R%RR/R0R<R=(RRR>RR1((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyt,test_identify_good_cookie_unknown_useridtypekscCsN|iddtƒ}|ihdd6ƒ}|i|ƒ}|i|dƒdS(NRR3sauth_tkt=bogusR4(RR;RR/R0R(RRRR1((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyttest_identify_bad_cookieyscCs†ddk}|idddddƒ}|iddd|iƒd ƒ}|ihd |d 6ƒ}|i|ƒ}|i|dƒdS( NiÿÿÿÿRttimeoutit reissue_timeiRRis auth_tkt=%sR4(RRR%RR/R0R(RRRR>RR1((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyt test_identify_bad_cookie_expireds  "cCso|idƒ}|iddƒ}|ihd|d6ƒ}|i|hdd6dd6ƒ}|i|dƒdS(NRRs auth_tkt=%sR4srepoze.who.useridR(RR%RtrememberR0R(RRR>RR1((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyttest_remember_creds_same‡s  cCsç|idƒ}|iddƒ}|ihd|d6ƒ}|iddddƒ}|i|hdd6dd6ƒ}|it|ƒdƒ|i|d d d |fƒ|i|d d d |fƒ|i|dd d|fƒdS(NRRs auth_tkt=%sR4totherRsrepoze.who.useridiis Set-Cookiesauth_tkt="%s"; Path=/is'auth_tkt="%s"; Path=/; Domain=localhostis(auth_tkt="%s"; Path=/; Domain=.localhost(RR%RRIR0R<(RRtold_valRtnew_valR1((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyttest_remember_creds_differents$     cCsù|iddtƒ}|iddddƒ}|ihd|d6ƒ}|iddd d ddƒ}|i|hdd 6d d 6ƒ}|it|ƒd ƒ|i|d d d|fƒ|i|dd d|fƒ|i|dd d|fƒdS(NRR3RR#s1.1.1.1s auth_tkt=%sR4RKRsrepoze.who.useridiis Set-Cookiesauth_tkt="%s"; Path=/is'auth_tkt="%s"; Path=/; Domain=localhostis(auth_tkt="%s"; Path=/; Domain=.localhost(RR;R%RRIR0R<(RRRLRRMR1((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyt(test_remember_creds_different_include_ip£s(      cCsÛ|idƒ}d}|ihd|d6ƒ}|iddddƒ}|i|hdd6dd6ƒ}|it|ƒd ƒ|i|d d d |fƒ|i|d d d|fƒ|i|dd d|fƒdS(NRtBOGUSs auth_tkt=%sR4RRKRsrepoze.who.useridiis Set-Cookiesauth_tkt="%s"; Path=/is'auth_tkt="%s"; Path=/; Domain=localhostis(auth_tkt="%s"; Path=/; Domain=.localhost(RRR%RIR0R<(RRRLRRMR1((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyt,test_remember_creds_different_bad_old_cookie¹s$     cCsú|idƒ}|iddƒ}|ihd|d6ƒ}|iddddddƒ}|i|hdd 6dd6d d gd6ƒ}|it|ƒd ƒ|i|d dd|fƒ|i|ddd|fƒ|i|ddd|fƒdS(NRRs auth_tkt=%sR4RKRRsfoo,barsrepoze.who.useridtfootbariis Set-Cookiesauth_tkt="%s"; Path=/is'auth_tkt="%s"; Path=/; Domain=localhostis(auth_tkt="%s"; Path=/; Domain=.localhost(RR%RRIR0R<(RRRLRRMR1((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyt3test_remember_creds_different_with_nonstring_tokensÍs*     cCs«|idƒ}|iddƒ}|ihd|d6ƒ}|iddddƒ}|i|hdd 6d d6ƒ}|it|ƒd ƒ|i|d d d|fƒdS(NRRs auth_tkt=%sR4RBRsuserid_type:intisrepoze.who.useridR5iis Set-Cookiesauth_tkt="%s"; Path=/(RR%RRIR0R<(RRRLRRMR1((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyt(test_remember_creds_different_int_useridæs  cCs±|idƒ}|iddƒ}|ihd|d6ƒ}|iddddƒ}|i|htdƒd 6d d6ƒ}|it|ƒd ƒ|i|d d d|fƒdS(NRRs auth_tkt=%sR4RBRsuserid_type:intisrepoze.who.useridR5iis Set-Cookiesauth_tkt="%s"; Path=/(RR%RRItlongR0R<(RRRLRRMR1((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyt)test_remember_creds_different_long_useridós  cCsá|idƒ}|iddƒ}|ihd|d6ƒ}tddƒ}|id|idƒddƒ}|i|h|d 6d d6ƒ}|it|d d ƒtƒ|it |ƒd ƒ|i|d dd|fƒdS(NRRs auth_tkt=%sR4s©sutf-8Rsuserid_type:unicodesrepoze.who.useridR5iiis Set-Cookiesauth_tkt="%s"; Path=/( RR%RtunicodetencodeRIR0ttypetstrR<(RRRLRRRMR1((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyt,test_remember_creds_different_unicode_useridÿs   c Csñddk}|idddƒ}|iddddd|iƒd ƒ}|ihd |d 6ƒ}|iddddƒ}|i|hdd 6dd6ƒ}|it|d dƒtƒ|it|ƒdƒ|i|d dd|fƒdS(NiÿÿÿÿRRGiRRR5Ris auth_tkt=%sR4srepoze.who.useridiis Set-Cookiesauth_tkt="%s"; Path=/( RRR%RRIR0RZR[R<(RRRRLRRMR1((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyttest_remember_creds_reissues   c Cs!ddkl}|ddddddƒ}|i|ƒ|id ƒ}|iƒ}|i|dƒ}|it|ƒd ƒ|d }|\}}|i|d ƒ|i|d ƒ|d}|\}}|i|d ƒ|i|dƒ|d}|\}}|i|d ƒ|i|dƒdS(Niÿÿÿÿ(tdatetimeiÙi iiiiRiis Set-CookiesHauth_tkt="INVALID"; Path=/; Max-Age=0; Expires=Thu, 05 Nov 2009 16:15:22isZauth_tkt="INVALID"; Path=/; Domain=localhost; Max-Age=0; Expires=Thu, 05 Nov 2009 16:15:22is[auth_tkt="INVALID"; Path=/; Domain=.localhost; Max-Age=0; Expires=Thu, 05 Nov 2009 16:15:22(R^RRRtforgetRR0R<( RR^tnowRRtheaderstheadertnameR(((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyt test_forgets,           cCs$ddkl}|it|ƒdS(Niÿÿÿÿ(t make_plugin(R Ret assertRaisest ValueError(RRe((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyt6test_factory_wo_secret_wo_secretfile_raises_ValueError;scCs*ddkl}|it|ddƒdS(Niÿÿÿÿ(ReRt secretfile(R ReRfRg(RRe((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyt4test_factory_w_secret_w_secretfile_raises_ValueError?scCs*ddkl}|it|ddƒdS(Niÿÿÿÿ(ReRis nonesuch.txt(R ReRfRg(RRe((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyt/test_factory_w_bad_secretfile_raises_ValueErrorCscCslddkl}|dƒ}|i|idƒ|i|idƒ|i|itƒ|i|itƒdS(Niÿÿÿÿ(ReRR(R ReR0RRR3R@R(RReR((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyttest_factory_w_secretGs  cCs§ddk}ddkl}ddkl}|ƒ}|_|ii|dƒ}t|dƒ}|i dƒ|i ƒ|i ƒ|d|ƒ}|i |i dƒdS( Niÿÿÿÿ(tmkdtemp(Res who.secrettwss33kr1t Rits33kr1t(tosttempfileRmR ReRtpathtjointopentwritetflushtcloseR0R(RRpRmReRRrRR((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyttest_factory_w_secretfileOs    cCsRddkl}|dddddƒ}|i|idƒ|i|idƒdS(Niÿÿÿÿ(ReRRFiRGi(R ReR0RFRG(RReR((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyt*test_factory_with_timeout_and_reissue_time\scCs9ddkl}|dddƒ}|i|i|ƒdS(Niÿÿÿÿ(ReRtuserid_checkers'repoze.who.plugins.auth_tkt:make_plugin(R ReR0Rz(RReR((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyt test_factory_with_userid_checkerbs  cCs |it|idddƒdS(NRRFi(RfRgR(R((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyttest_timeout_no_reissueiscCs&|it|idddddƒdS(NRRFiRGi(RfRgR(R((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyttest_timeout_lower_than_reissuelscCsû|iddtƒ}|iddƒ}|ihd|d6ƒ}|i|ƒ}|it|ƒdƒ|i|dd gƒ|i|d dƒ|i|d d ƒ|id |jƒ|i|d d gƒ|i|dd ƒ|i|ddƒdS(NRRzRtexistings auth_tkt=%sR4iRR5srepoze.who.useridRR6R7R8R9R:(Rtdummy_userid_checkerR%RR/R0R<R=(RRR>RR1((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyt/test_identify_with_checker_and_existing_accountpscCs‡|iddtƒ}|iddƒ}|ihd|d6ƒ}|iƒ}|i|ƒ}|i|dƒ|d=|i||ƒdS(NRRzRt nonexistings auth_tkt=%sR4s paste.cookies(RRR%RtcopyR/R0R(RRR>Rtoriginal_environR1((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyt3test_identify_with_checker_and_non_existing_account~s cCsW|idƒ}hdd6}|iddddƒ}|i|hdd6d d 6ƒ}|id ƒ\}}|id |ƒ|i|id |ƒ|ƒ|id|jƒ|id ƒ\}}|id |ƒ|i|id|ƒ|ƒ|id|jƒ|id ƒ\}}|id |ƒ|i|id|ƒ|ƒ|id|jƒdS(NRs example.comt HTTP_HOSTRtchrisRR5srepoze.who.useridt500tmax_ageis Set-Cookies"auth_tkt="%s"; Path=/; Max-Age=500s ; Expires=s6auth_tkt="%s"; Path=/; Domain=example.com; Max-Age=500s7auth_tkt="%s"; Path=/; Domain=.example.com; Max-Age=500(RR%RItpopR0R=t startswith(RRRttktR1RcR(((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyttest_remember_max_ageŠs2   N(+t__name__t __module__RRRRR R RRR@R%RR.R2R?RARCRDRERHRJRNRORQRTRURWR\R]RdRhRjRkRlRxRyR{R|R}R€R„RŒ(((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyRsT                                cCs |djS(NR~((R((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyRªs(tunittesttTestCaseRR(((sI/usr/lib/python2.6/site-packages/repoze/who/plugins/tests/test_authtkt.pyts ÿ¨