You might need to do:
from zope.globalrequest import setRequest
setRequest(app.REQUEST)
to make sure that the request is fully set up for any code that uses zope.globalrequest.getRequest
You might need to do:
from zope.globalrequest import setRequest
setRequest(app.REQUEST)
to make sure that the request is fully set up for any code that uses zope.globalrequest.getRequest