[Checkins] SVN: z3c.form/trunk/src/z3c/form/button.txt Get coverage to 100% again.

Stephan Richter srichter at cosmos.phy.tufts.edu
Tue Oct 9 21:50:51 EDT 2007


Log message for revision 80754:
  Get coverage to 100% again.
  

Changed:
  U   z3c.form/trunk/src/z3c/form/button.txt

-=-
Modified: z3c.form/trunk/src/z3c/form/button.txt
===================================================================
--- z3c.form/trunk/src/z3c/form/button.txt	2007-10-09 17:30:58 UTC (rev 80753)
+++ z3c.form/trunk/src/z3c/form/button.txt	2007-10-10 01:50:50 UTC (rev 80754)
@@ -583,3 +583,29 @@
   >>> imgSubmitAction.isExecuted()
   True
 
+The "image" type of the "input"-element also requires there to be a `src`
+attribute, which is the URL to the image to be used. The attribute is also
+supported by the Python API. However, in order for the attribute to work, the
+image must be available as a resource, so let's do that now:
+
+  # Traversing setup
+  >>> from zope.traversing import testing
+  >>> testing.setUp()
+
+  # Resource namespace
+  >>> import zope.component
+  >>> from zope.traversing.interfaces import ITraversable
+  >>> from zope.traversing.namespace import resource
+  >>> zope.component.provideAdapter(
+  ...     resource, (None,), ITraversable, name="resource")
+  >>> zope.component.provideAdapter(
+  ...     resource, (None, None), ITraversable, name="resource")
+
+  # Register the "submit.png" resource
+  >>> from zope.app.publisher.browser.resource import Resource
+  >>> testing.browserResource('submit.png', Resource)
+
+Now the attribute can be called:
+
+  >>> imgSubmitAction.src
+  u'http://127.0.0.1/@@/submit.png'



More information about the Checkins mailing list