[ZDP] BackTalk to Document Zope Developer's Guide (2.4 edition)/Testing and Debugging
webmaster@zope.org
webmaster@zope.org
Sat, 09 Nov 2002 15:03:18 -0500
A comment to the paragraph below was recently added via http://www.zope.org/Documentation/Books/ZDG/current/TestingAndDebugging.stx#3-35
---------------
Some times you may run into trouble if your test assuming that
there is a current Zope request. There are two ways to deal with
this. One is to use the 'makerequest' utility module to create a
fake request. For example::
class MyTest(unittest.TestCase):
...
def setup(self):
import Zope
from Testing import makerequest
self.app=makerequest.makerequest(Zope.app())
% Anonymous User - Nov. 9, 2002 3:03 pm:
/if your test assuming/if your test assumes/