Roger Ineichen wrote:
Log message for revision 40515:
  Using getLink('File') will end in a testing failure in our application
  because we use a content type '- File' which produce a link called '- File'.
Use the more concrete url attribute instead of the text attribute in the getLink method will avoid this. See also collector issue at:

Modified: Zope3/trunk/src/zope/app/apidoc/codemodule/browser/introspector.txt
--- Zope3/trunk/src/zope/app/apidoc/codemodule/browser/introspector.txt 
2005-12-03 04:34:49 UTC (rev 40514)
+++ Zope3/trunk/src/zope/app/apidoc/codemodule/browser/introspector.txt 
2005-12-03 12:32:48 UTC (rev 40515)
@@ -134,7 +134,8 @@
 they are provided in a aseparate section. To see anything useful, we have to
 add an object to the folder first:
- >>> browser.getLink('File').click()
+    >>> link = 'http://localhost/@@+/action.html?'
+    >>> browser.getLink(url=link).click()
     >>> import cStringIO
     >>> browser.getControl('Data').value = cStringIO.StringIO('content')
     >>> browser.getControl(name='add_input_name').value = 'file.txt'

This isn't really in the "spirit" of testbrowser. Previously the test would ensure that the desired link appeared on the page, was named correctly (if a bit too generically), and that it went to the appropriate place. The new version just makes sure the hard-coded URL points to the correct page.

I prefer some variation on the previous style (with appropriate correction so it isn't so brittle). Comments/ideas?
Benji York
Senior Software Engineer
Zope Corporation
Zope3-dev mailing list

Reply via email to