[ZDP] BackTalk to Document Zope Developer's Guide (2.4 edition)/Testing and Debugging
webmaster@zope.org
webmaster@zope.org
Thu, 08 May 2003 07:13:49 -0400
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/
% to_be - May 8, 2003 7:13 am:
this isn't very understandable for someone who tries to add tests to his product the first time. How is this
'app' used then?
Is it possible to just create a "REQUEST" object which can then be passed as an argument?