Open mikeorr opened 11 years ago
import beaker.session
import pyramid.testing
# Create a dummy request
req = pyramid.testing.DummyRequest()
# Create a SessionObject
so = beaker.session.SessionObject(req)
# Access the session object directly from SessionObject
session = so._session()
# Check the length of the session
session_length = len(session)
print("Session length:", session_length)
The SessionObject proxy used by pyramd_beaker does not proxy the
__len__
method to the Session, solen(session)
doesn't work.