[ZCM] [ZC] 985/ 2 Comment "import Testing changes attributes available to Zope.app()"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Fri Sep 24 05:39:17 EDT 2004


Issue #985 Update (Comment) "import Testing changes attributes available to Zope.app()"
 Status Pending, Zope/bug low
To followup, visit:
  http://collector.zope.org/Zope/985

==============================================================
= Comment - Entry #2 by regebro on Sep 24, 2004 5:39 am

You should run Zope.app(), shouldn't you? I don't think this is a bug. If you think it is could you explain more carefulyy why it is a bug?
________________________________________
= Request - Entry #1 by Anonymous User on Jul 24, 2003 5:04 am

 Background: Tried to implement a few tests for objects inside Zope. Followed the examples in Zope Developer's Guide, chapter on Testing to add a Request object. The problem (bug?) is that my own folders aren't visible if I import Testing before executing Zope.app().

 I.e this code produces errors 

 def setUp(self):
   self.fix_path()
   import Zope
   from Testing import makerequest
   self.app = makerequest.makerequest(Zope.app())
   # printout to show error
   print self.app.objectIds()

 Printout: 
 ['acl_users', 'Control_Panel', 'temp_folder', 'browser_id_manager', 'session_data_manager', 'Examples', 'error_log', 'index_html', 'standard_error_message', 'standard_html_footer', 'standard_html_header', 'standard_template.pt']

 =====

 while this code (where I run Zope.app() before the import) works.

 def setUp(self):
   self.fix_path()
   import Zope
   self.app=Zope.app()
   from Testing import makerequest
   self.app = makerequest.makerequest(self.app)
   print self.app.objectIds()

 Printout: (note own folder WSTest at end)
 ['acl_users', 'Control_Panel', 'standard_html_header', 'standard_html_footer', 'standard_error_message', 'index_html', 'temp_folder', 'browser_id_manager', 'session_data_manager', 'Examples', 'error_log', 'standard_template.pt', 'WSTest']

 ======

 So, the line import Testing seems to change the behaviour of Zope.app(). Took me by surprise for sure.

 Hope this is of any use.
==============================================================



More information about the Zope-Collector-Monitor mailing list