mς γΈEc@s^dZdkZdklZdklZdefd„ƒYZd„Zd„Zd„Z dS( s-Unit tests for the testbrowser module. $Id$ N(sFunctionalDocTestSuite(sItemt CookieStubcBstZdZd„ZRS(sThis is a cookie stub.cCs|iiddƒdS(NteviltcookietStub(tREQUESTtRESPONSEt setCookie(tselfR((tC/data/zmath/zope/lib/python/Products/Five/tests/test_testbrowser.pyt__call__s(t__name__t __module__t__doc__R (((RRs cCsdS(s) We want to make sure that our testbrowser correctly understands cookies. We'll add a stub to ``self.folder`` that sets a cookie. >>> from Products.Five.tests.test_testbrowser import CookieStub >>> self.folder._setObject('stub', CookieStub()) 'stub' This response looks alright: >>> response = self.publish('/test_folder_1_/stub') >>> print str(response) #doctest: +ELLIPSIS Status: 200 OK ... Set-Cookie: evil="cookie" ... Let's try to look at the same folder with testbrowser: >>> from Products.Five.testbrowser import Browser >>> browser = Browser() >>> browser.open('http://localhost/test_folder_1_/stub') >>> 'Set-Cookie: evil="cookie"' in str(browser.headers) True N((((Rtdoctest_cookiesscCsdS(s²Make sure that the headers come out in camel case. Some setup: >>> from Products.Five.tests.test_testbrowser import CookieStub >>> self.folder._setObject('stub', CookieStub()) 'stub' The Zope2 response mungs headers so they come out in camel case we should do the same. This is also more consistent with the Zope3 testbrowser tests. We will test a few: >>> from Products.Five.testbrowser import Browser >>> browser = Browser() >>> browser.open('http://localhost/test_folder_1_/stub') >>> 'Content-Length: ' in str(browser.headers) True >>> 'Content-Type: ' in str(browser.headers) True N((((Rtdoctest_camel_case_headers9scCstitƒfƒS(N(tunittestt TestSuitetFunctionalDocTestSuite(((Rt test_suitePs( R RtTesting.ZopeTestCaseRtOFS.SimpleItemtItemRR RR(RRRRRRR ((Rt?s