Avoid using a weakref.proxy for CallContext.request because we need to get a real ref to the request at some point in the tests

This commit is contained in:
Christophe de Vienne 2012-01-18 20:04:00 +01:00
parent 4fbfa81099
commit 391165d812
2 changed files with 6 additions and 2 deletions

View File

@ -13,12 +13,16 @@ registered_protocols = {}
class CallContext(object):
def __init__(self, request):
self.request = weakref.proxy(request)
self._request = weakref.ref(request)
self.path = None
self.func = None
self.funcdef = None
@property
def request(self):
return self._request()
def register_protocol(protocol):
registered_protocols[protocol.name] = protocol

View File

@ -24,7 +24,7 @@ class DummyProtocol(object):
return ['touch']
def read_arguments(self, context):
self.lastreq = context.request.__init__.__self__
self.lastreq = context.request
self.hits += 1
return {}