[Zope3-checkins] CVS: Zope3/src/zope/publisher/tests - test_http.py:1.17
Viktorija Zaksiene
ryzaja@codeworks.lt
Tue, 22 Jul 2003 05:34:14 -0400
Update of /cvs-repository/Zope3/src/zope/publisher/tests
In directory cvs.zope.org:/tmp/cvs-serv19565/src/zope/publisher/tests
Modified Files:
test_http.py
Log Message:
Added http_transaction attribute to the HTTPResponse. It is used for the
logging instead of _outstream attribute because _outstream may not know
about the user.
=== Zope3/src/zope/publisher/tests/test_http.py 1.16 => 1.17 ===
--- Zope3/src/zope/publisher/tests/test_http.py:1.16 Mon Jun 9 12:39:15 2003
+++ Zope3/src/zope/publisher/tests/test_http.py Tue Jul 22 05:33:40 2003
@@ -205,12 +205,17 @@
def testSetUser(self):
class HTTPTaskStub:
+ auth_user_name = None
def setAuthUserName(self, name):
self.auth_user_name = name
task = HTTPTaskStub()
req = self._createRequest(outstream=task)
req.setUser(UserStub("jim"))
- self.assertEquals(req.response._outstream.auth_user_name, "jim")
+ self.assert_(not req.response._outstream.auth_user_name)
+ req = self._createRequest(outstream=task)
+ req.response.setHTTPTransaction(task)
+ req.setUser(UserStub("jim"))
+ self.assertEquals(req.response.http_transaction.auth_user_name, "jim")
def testIPresentationRequest(self):
# test the IView request