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:
parent
4fbfa81099
commit
391165d812
@ -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
|
||||
|
@ -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 {}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user