PNG  IHDR;IDATxܻn0K )(pA 7LeG{ §㻢|ذaÆ 6lذaÆ 6lذaÆ 6lom$^yذag5bÆ 6lذaÆ 6lذa{ 6lذaÆ `}HFkm,mӪôô! x|'ܢ˟;E:9&ᶒ}{v]n&6 h_tڠ͵-ҫZ;Z$.Pkž)!o>}leQfJTu іچ\X=8Rن4`Vwl>nG^is"ms$ui?wbs[m6K4O.4%/bC%t Mז -lG6mrz2s%9s@-k9=)kB5\+͂Zsٲ Rn~GRC wIcIn7jJhۛNCS|j08yiHKֶۛkɈ+;SzL/F*\Ԕ#"5m2[S=gnaPeғL lذaÆ 6l^ḵaÆ 6lذaÆ 6lذa; _ذaÆ 6lذaÆ 6lذaÆ RIENDB`  ]c@sddlmZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z ddl m Z ddlmZddlmZmZmZdd lmZmZmZdd lmZdd lmZmZmZdd lmZdd l m!Z!ddl"m#Z#ddl$m%Z%ddl&m'Z'ddl(m)Z)m*Z*m+Z+ddl,m-Z-m.Z.ddl/m0Z0ddl1m2Z2ddl3m4Z4m5Z5m6Z6d.Z7dZ8de8Z9ej:dZ;ej:dZ<de=fd YZ>d!e?fd"YZ@d#ZAd$ZBd%efd&YZCd'ZDd(ZEd)ZFd*e?fd+YZGd,eGfd-YZHdS(/i(tunicode_literalsN(tcopy(t import_module(tBytesIO(tsettings(t BaseHandler(t ISO_8859_1tUTF_8t WSGIRequest(tgot_request_exceptiontrequest_finishedtrequest_started(tclose_old_connections(t HttpRequestt QueryDictt SimpleCookie(tTemplateDoesNotExist(tsignals(t ContextList(tresolve(tsix(t force_bytest force_strt uri_to_iri(tSimpleLazyObjecttcurry(t urlencode(t is_iterable(turljointurlparseturlsplituClientuRedirectCycleErroruRequestFactoryu encode_fileuencode_multipartuBoUnDaRyStRiNgu multipart/form-data; boundary=%su.*; charset=([\w\d-]+);?u^application\/(vnd\..+\+)?jsontRedirectCycleErrorcBseZdZdZRS(uC The test client has been asked to follow a redirect loop. cCs/tt|j|||_|j|_dS(N(tsuperRt__init__t last_responsetredirect_chain(tselftmessageR"((s6/usr/lib/python2.7/site-packages/django/test/client.pyR!-s (t__name__t __module__t__doc__R!(((s6/usr/lib/python2.7/site-packages/django/test/client.pyR)st FakePayloadcBs8eZdZddZdZddZdZRS(u A wrapper around BytesIO that restricts what can be read since data from the network can't be seeked and cannot be read outside of its content length. This makes sure that views can't do anything under the test client that wouldn't work in Real Life. cCs>t|_d|_t|_|dk r:|j|ndS(Ni(Rt_FakePayload__contentt_FakePayload__lentFalset read_startedtNonetwrite(R$tcontent((s6/usr/lib/python2.7/site-packages/django/test/client.pyR!:s     cCs|jS(N(R+(R$((s6/usr/lib/python2.7/site-packages/django/test/client.pyt__len__AscCsh|js%|jjdt|_n|dkrC|jp=d}n|jj|}|j|8_|S(Ni(R-R*tseektTrueR.R+tread(R$t num_bytesR0((s6/usr/lib/python2.7/site-packages/django/test/client.pyR4Ds   cCsM|jrtdnt|}|jj||jt|7_dS(Nu.Unable to write a payload after he's been read(R-t ValueErrorRR*R/R+tlen(R$R0((s6/usr/lib/python2.7/site-packages/django/test/client.pyR/Os   N(R&R'R(R.R!R1R4R/(((s6/usr/lib/python2.7/site-packages/django/test/client.pyR)3s    ccsCzx|D] }|Vq WWdtjt|tjtXdS(N(R t disconnectR tconnect(titerabletclosetitem((s6/usr/lib/python2.7/site-packages/django/test/client.pytclosing_iterator_wrapperWs    cCsd|jkodkns.|jd krY|jrCg|_n d|_d|dsu--%su)Content-Disposition: form-data; name="%s"uc3s|]}|VqdS(N((RbRc(R](s6/usr/lib/python2.7/site-packages/django/test/client.pys su--%s--R>s (titemstextendt encode_filet isinstanceRt string_typesRtjoin(tboundarytdatatlinesRatkeytvalueR<((R]s6/usr/lib/python2.7/site-packages/django/test/client.pytencode_multiparts0       cCsd}t|do*t|jtj}|rHtjj|jnd}t|dri|j}n"|rt j |d}nd}|dkrd}n|s|}n|d||d||f|d |d ||j gS( NcSst|tjS(N(RRR[(R\((s6/usr/lib/python2.7/site-packages/django/test/client.pyR]sunameuu content_typeiuapplication/octet-streamu--%su8Content-Disposition: form-data; name="%s"; filename="%s"uContent-Type: %sR>( R^RgtnameRRhtostpathtbasenamet content_typet mimetypest guess_typeR.R4(RjRmtfileR]tfile_has_string_nametfilenameRt((s6/usr/lib/python2.7/site-packages/django/test/client.pyRfs$ $!       tRequestFactorycBseZdZdZdZdZdZdZde dZ de e dZ de dZ e d Zd d e d Zd d e d Zd d e dZd d e dZd d e dZRS(uV Class that lets you create mock Request objects for use in testing. Usage: rf = RequestFactory() get_request = rf.get('/hello/') post_request = rf.post('/submit/', {'foo': 'bar'}) Once you have a request object you can pass it to any view function, just as if that view had been hooked up using a URLconf. cKs%||_t|_t|_dS(N(tdefaultsRtcookiesRterrors(R$R{((s6/usr/lib/python2.7/site-packages/django/test/client.pyR!s  cKsi|jjddddd6tdd6tdd 6td d 6tdd 6td d6tdd6tdd6dd6tdd6tdd6|jd6td6td6td6}|j|j|j||S(u5 The base environment for a request. theaderutsepu; u HTTP_COOKIEu/u PATH_INFOu 127.0.0.1u REMOTE_ADDRuGETuREQUEST_METHODu SCRIPT_NAMEu testserveru SERVER_NAMEu80u SERVER_PORTuHTTP/1.1uSERVER_PROTOCOLiiu wsgi.versionuhttpuwsgi.url_schemeR>u wsgi.inputu wsgi.errorsuwsgi.multiprocessuwsgi.multithreadu wsgi.run_once(ii( R|toutputtstrR)R}R3R,tupdateR{(R$RCRK((s6/usr/lib/python2.7/site-packages/django/test/client.pyt _base_environs&            cKst|j|S(u#Construct a generic request object.(RR(R$RC((s6/usr/lib/python2.7/site-packages/django/test/client.pyRC1scCs]|tkrtt|Stj|}|r@|jd}n tj}t|d|SdS(Nitencoding( tMULTIPART_CONTENTRotBOUNDARYtCONTENT_TYPE_REtmatchtgroupRR[R(R$RkRtRtcharset((s6/usr/lib/python2.7/site-packages/django/test/client.pyt _encode_data5s   cCsjt|d}|dr;|tdt|d7}nt|jt}tjrf|jtS|S(Niiu;( RRRtencodeRRtPY3tdecodeR(R$tparsedRr((s6/usr/lib/python2.7/site-packages/django/test/client.pyt _get_pathAs  !cKsW|dkrin|}it|dtd6}|j||jd|d||S(uConstruct a GET request.tdosequ QUERY_STRINGuGETtsecureN(R.RR3Rtgeneric(R$RrRkRtextratr((s6/usr/lib/python2.7/site-packages/django/test/client.pytgetLs  cKsI|dkrin|}|j||}|jd|||d||S(uConstruct a POST request.uPOSTRN(R.RR(R$RrRkRtRRt post_data((s6/usr/lib/python2.7/site-packages/django/test/client.pytpostVscKsW|dkrin|}it|dtd6}|j||jd|d||S(uConstruct a HEAD request.Ru QUERY_STRINGuHEADRN(R.RR3RR(R$RrRkRRR((s6/usr/lib/python2.7/site-packages/django/test/client.pythead`s  cKs|jd|d||S(uConstruct a TRACE request.uTRACER(R(R$RrRR((s6/usr/lib/python2.7/site-packages/django/test/client.pyttracejsuuapplication/octet-streamcKs|jd|||d||S(uConstruct an OPTIONS request.uOPTIONSR(R(R$RrRkRtRR((s6/usr/lib/python2.7/site-packages/django/test/client.pytoptionsnscKs|jd|||d||S(uConstruct a PUT request.uPUTR(R(R$RrRkRtRR((s6/usr/lib/python2.7/site-packages/django/test/client.pytputtscKs|jd|||d||S(uConstruct a PATCH request.uPATCHR(R(R$RrRkRtRR((s6/usr/lib/python2.7/site-packages/django/test/client.pytpatchzscKs|jd|||d||S(uConstruct a DELETE request.uDELETER(R(R$RrRkRtRR((s6/usr/lib/python2.7/site-packages/django/test/client.pytdeletesc Ks#tt|}t|tj}i|j|d6t|d6|rVtdn tdd6|rutdn tdd6}|r|jit|d 6t|d 6t |d 6n|j||j d st|d } t j r | j d} n| |d siiN(u500.html(RRRZtidRttemplate_renderedR9R RRRRHRR.RtreraisetclientRCRt templatesRYt _parse_jsontjsonRtresolver_matchR7R|RR8( R$RCRKRkton_template_rendert signal_uidt exception_uidRDteR((RCs6/usr/lib/python2.7/site-packages/django/test/client.pyRCs<       cKsFtt|j|d|d||}|rB|j||}n|S(u@ Requests a response from the server using GET. RkR(R RRt_handle_redirects(R$RrRktfollowRRRD((s6/usr/lib/python2.7/site-packages/django/test/client.pyRs  c KsLtt|j|d|d|d||}|rH|j||}n|S(uA Requests a response from the server using POST. RkRtR(R RRR(R$RrRkRtRRRRD((s6/usr/lib/python2.7/site-packages/django/test/client.pyRs  cKsFtt|j|d|d||}|rB|j||}n|S(u@ Request a response from the server using HEAD. RkR(R RRR(R$RrRkRRRRD((s6/usr/lib/python2.7/site-packages/django/test/client.pyR)s  uuapplication/octet-streamc KsLtt|j|d|d|d||}|rH|j||}n|S(uC Request a response from the server using OPTIONS. RkRtR(R RRR(R$RrRkRtRRRRD((s6/usr/lib/python2.7/site-packages/django/test/client.pyR3s  c KsLtt|j|d|d|d||}|rH|j||}n|S(u: Send a resource to the server using PUT. RkRtR(R RRR(R$RrRkRtRRRRD((s6/usr/lib/python2.7/site-packages/django/test/client.pyR?s  c KsLtt|j|d|d|d||}|rH|j||}n|S(u< Send a resource to the server using PATCH. RkRtR(R RRR(R$RrRkRtRRRRD((s6/usr/lib/python2.7/site-packages/django/test/client.pyRKs  c KsLtt|j|d|d|d||}|rH|j||}n|S(u6 Send a DELETE request to the server. RkRtR(R RRR(R$RrRkRtRRRRD((s6/usr/lib/python2.7/site-packages/django/test/client.pyRWs  cKsFtt|j|d|d||}|rB|j||}n|S(u5 Send a TRACE request to the server. RkR(R RRR(R$RrRkRRRRD((s6/usr/lib/python2.7/site-packages/django/test/client.pyRcs'cKs;ddlm}||}|r3|j|tStSdS(u Sets the Factory to appear as if it has successfully logged into a site. Returns True if login is possible; False if the provided credentials are incorrect. i(t authenticateN(tdjango.contrib.authRt_loginR3R,(R$t credentialsRtuser((s6/usr/lib/python2.7/site-packages/django/test/client.pytloginls   cCs>d}|dkr!|}n||_|j||dS(NcSsGddlm}x0tjD]%}||}t|dr|SqWdS(Ni(t load_backenduget_user(RRRtAUTHENTICATION_BACKENDSR^(Rt backend_pathtbackend((s6/usr/lib/python2.7/site-packages/django/test/client.pyt get_backend|s  (R.RR(R$RRR((s6/usr/lib/python2.7/site-packages/django/test/client.pyt force_login{s     cCsddlm}ttj}t}|jr@|j|_n|j|_|||||jjtj }|jj |j |sN       $ 1 1