[Testbot] Plone 5.0 - Python 2.7 - Build # 3094 - Regression! - 0 failure(s)

jenkins at plone.org jenkins at plone.org
Sat Aug 23 05:39:32 UTC 2014


-------------------------------------------------------------------------------
Plone 5.0 - Python 2.7 - Build # 3094 - Failure!
-------------------------------------------------------------------------------

http://jenkins.plone.org/job/plone-5.0-python-2.7/3094/


-------------------------------------------------------------------------------
CHANGES
-------------------------------------------------------------------------------

Repository: plone.directives.form
Branch: refs/heads/master
Date: 2014-08-23T01:17:30+02:00
Author: Gil Forcada (gforcada) <gforcada at gnome.org>
Commit: https://github.com/plone/plone.directives.form/commit/ceedcee1f38fb4e8fedc397ab181f9e1746a5d5b

Whitespaces cleanup

Files changed:
M README.txt
M docs/HISTORY.txt
M plone/directives/form/__init__.py
M plone/directives/form/error.py
M plone/directives/form/form.py
M plone/directives/form/meta.py
M plone/directives/form/tests/schema.txt
M plone/directives/form/tests/test_error.py
M plone/directives/form/tests/test_form.py
M plone/directives/form/tests/test_schema.py
M plone/directives/form/tests/test_validator.py
M plone/directives/form/tests/test_value.py
M plone/directives/form/validator.py
M plone/directives/form/value.py

diff --git a/README.txt b/README.txt
index 62e5142..b1e47d1 100644
--- a/README.txt
+++ b/README.txt
@@ -27,11 +27,11 @@ in your ``configure.zcml``::
 
     <include package="plone.directives.form" file="meta.zcml" />
     <include package="plone.directives.form" />
-    
+
 or if you declare dependencies in setup.py using install_requires::
 
     <includeDependencies package="." />
-        
+
 Schemata loaded from XML
 ------------------------
 
@@ -46,7 +46,7 @@ a form from a schema, using hints stored in tagged values on that schema to
 control the form's layout and field widgets. These directives have now moved
 to other packages to avoid a dependency of Dexterity on grok.
 
-The ``fieldset`` and ``primary`` directives are now in 
+The ``fieldset`` and ``primary`` directives are now in
 ``plone.supermodel.model``.
 
 The ``omitted``, ``no_omit``, ``mode``, ``widget``, ``order_before``,
@@ -63,15 +63,15 @@ computed values. For example::
 
     from plone.directives import form
     from zope import schema
-    
+
     class IMySchema(form.Schema):
-    
+
         title = schema.TextLine(title=u"Title")
 
     @form.default_value(field=IMySchema['title'])
     def default_title(data):
         return data.context.suggested_title
-        
+
 The decorator takes one or more discriminators. The available discriminators
 for ``default_value`` are:
 
@@ -93,7 +93,7 @@ field
 
 widget
     The widget type (e.g. an interface).
-    
+
 You must specify either ``field`` or ``widget``. The object passed to the
 decorated function has an attribute for each discriminator.
 
@@ -102,12 +102,12 @@ There are two more decorators:
 widget_label
   Provide a dynamic label for a widget. Takes the same discriminators as the
   ``default_value`` decorator.
-  
+
 button_label -- Provide a dynamic label for a button. Takes parameters
   content (alias context), request (alias layer), form (alias view),
   manager and button.
 
-Please note the rather unfortunate differences in naming between the button 
+Please note the rather unfortunate differences in naming between the button
 descriptors (content vs. context, form vs. view) and the widget ones. The
 descriptor will accept the same names, but the data object passed to the
 function will only contain the names as defined in z3c.form, so be careful.
@@ -130,11 +130,11 @@ widget validator, called ``@form.validator()``::
 
     from plone.directives import form
     from zope import schema
-    
+
     class IMySchema(form.Schema):
-    
+
         title = schema.TextLine(title=u"Title")
-    
+
     @form.validator(field=IMySchema['title'])
     def validateTitle(value):
         if value == value.upper():
@@ -184,13 +184,13 @@ decorator. For example::
 
     from plone.directives import form
     from zope import schema
-    
+
     from zope.schema.interfaces import TooShort
-    
+
     class IMySchema(form.Schema):
-    
+
         title = schema.TextLine(title=u"Title", min_length=2)
-    
+
     @form.error_message(error=TooShort, field=IMySchema['title'])
     def titleTooShort(value):
         return u"The title '%s' is too short" % value
@@ -272,13 +272,13 @@ The base classes can all be imported from ``plone.directives.form``, e.g::
     from five import grok
     from plone.directives import form, button
     from z3c.form import field
-    
+
     class MyForm(form.Form):
         grok.context(ISomeContext)
         grok.require('zope2.View')
-        
+
         fields = field.Fields(IMyFormSchema)
-        
+
         @button.buttonAndHandler(u'Submit')
         def handleApply(self, action):
             data, errors = self.extractData()
@@ -293,61 +293,61 @@ The allowed directives are:
   for standard forms, ``cmf.ModifyPortalContent`` for edit forms, and
   ``cmf.AddPortalContent`` for add forms.
 * ``grok.layer()`` to specify a browser layer
-* ``grok.name()`` to set a different name. By default your form will be 
-  available as view @@yourformclassnamelowercase, but you can use 
+* ``grok.name()`` to set a different name. By default your form will be
+  available as view @@yourformclassnamelowercase, but you can use
   ``grok.name()`` to set name explicitly.
 * ``form.wrap()`` to wrap the form in a layout wrapper view. You can pass
   an argument of ``True`` or ``False`` to enable or disable wrapping. If no
   argument is given, it defaults to ``True``. If omitted, the global default
   is used, which is to wrap in Zope 2.11 or earlier, and to not wrap in Zope
   2.12 or later
-  
+
 More complex example how to use Grok directives with a form::
 
         from plone.directives import form
         from Products.CMFCore.interfaces import ISiteRoot
-  
+
         class CompanyCreationForm(form.SchemaForm):
-            """ A sample form how to "create companies". 
-            
+            """ A sample form how to "create companies".
+
             """
-                      
-            # Which plone.directives.form.Schema subclass is used to define 
+
+            # Which plone.directives.form.Schema subclass is used to define
             # fields for this form (not shown on this example)
             schema = ICompanyCreationFormSchema
-            
+
             # Permission required to view/submit the form
             grok.require("cmf.ManagePortal")
-            
+
             # The form does not care about the context object
             # and  should not try to extract field value
             # defaults out of it
             ignoreContext = True
-            
+
             # This form is available at the site root only
             grok.context(ISiteRoot)
-        
+
             # The form will be available in Plone site root only
             # Use http://yourhost/@@create_company URL to access this form
             grok.name("create_company")
-    
-    
+
+
 
 
 Each of the form base classes has a "schema" equivalent, which can be
 initialised with a ``schema`` attribute instead of the ``fields`` attribute.
 These forms use `plone.autoform`_'s ``AutoExtensibleForm`` as a base class,
 allowing schema hints as shown above to be processed::
-    
+
     from plone.directives import form
     from z3c.form import field
-    
+
     class MyForm(form.SchemaForm):
         grok.context(ISomeContext)
         grok.require('zope2.View')
-        
+
         schema = IMySchema
-        
+
         @button.buttonAndHandler(u'Submit')
         def handleApply(self, action):
             data, errors = self.extractData()
@@ -390,24 +390,24 @@ DisplayForm
     that is initialised with display widgets. See `plone.autoform`_'s
     ``WidgetsView`` for more details.
 
-All of the grokked form base classes above support associating a custom 
+All of the grokked form base classes above support associating a custom
 template with the form. This uses the same semantics as ``grok.View``. See
 `grokcore.view`_ for details, but briefly:
 
-* If you want to completely customise rendering, you can override the 
+* If you want to completely customise rendering, you can override the
   ``render()`` method.
 * If you want to use a page template to render a form called ``MyForm`` in
   the module ``my.package.forms``, create a directory inside ``my.package``
   called ``forms_templates`` (the prefix should match the module name),
   and place a file there called ``myform.pt``.
-* If you do neither, the default form template will be used, as is the 
+* If you do neither, the default form template will be used, as is the
   standard behaviour in z3c.form.
 
 Note that the automatically associated form template can use ``grok.View``
 methods, such as ``view.url()`` and ``view.redirect()``, which are defined
 in the grokked form base classes.
 
-Also note that you can use the view ``@@ploneform-macros`` from 
+Also note that you can use the view ``@@ploneform-macros`` from
 `plone.app.z3cform`_ if you want to use some of the standard form markup.
 For example, the ``titlelessform`` macro will render the ``<form >`` element
 and all fieldsets and fields::
@@ -424,7 +424,7 @@ When you try to access your form on the site, you'll get page not found (NotFoun
 
 * Make sure that you typed your form name correctly and it matches ``grok.name()``
   or lowercased class name
-  
+
 * Make sure you have <include package="plone.directives.form" file="meta.zcml" />
   or similar in configure.zcml of your add-on product
 
diff --git a/docs/HISTORY.txt b/docs/HISTORY.txt
index 82e7b8f..2669d19 100644
--- a/docs/HISTORY.txt
+++ b/docs/HISTORY.txt
@@ -22,18 +22,18 @@ Changelog
   which is in fact ``form.wrap()``
   [romanofski]
 
-* A number of schema directives were moved to other packages and reimplemented 
-  to not depend on grok.  The ``Schema`` class and the ``model``, ``fieldset``, 
-  and ``primary`` directives were moved to ``plone.supermodel.model``. The 
-  ``omitted``, ``no_omit``, ``mode``, ``widget``, ``order_before``, 
-  ``order_after``, ``read_permission``, and ``write_permission`` directives were 
+* A number of schema directives were moved to other packages and reimplemented
+  to not depend on grok.  The ``Schema`` class and the ``model``, ``fieldset``,
+  and ``primary`` directives were moved to ``plone.supermodel.model``. The
+  ``omitted``, ``no_omit``, ``mode``, ``widget``, ``order_before``,
+  ``order_after``, ``read_permission``, and ``write_permission`` directives were
   moved to ``plone.autoform.directives``.
-  
+
   For now the directives are still available under their old names in this
   package, but they are deprecated and may be removed at some point.
-  
+
   Some minor related changes:
-  
+
   * Tagged values are now stored on schemas as soon as they are defined, rather
     than when the schemas are grokked. Additional actions required by the
     directives, if any, are performed at the end of ZCML configuration.
@@ -41,7 +41,7 @@ Changelog
     the `first` base class of any schema to which the directives should apply.
     Also, unfortunately it is no longer possible to give an error if the schema
     directives are called on an interface that is not a ``Schema``.
-  
+
   [davisagli]
 
 1.0 - 2011-05-20
@@ -55,7 +55,7 @@ Changelog
 * Allow arbitrary extra parameters for the fieldset directive. This is useful
   for extensions that want to tweak fieldset behaviour or rendering.
   [wichert]
-  
+
 * Add ``no_omit`` directive, so that fields that have been omitted can be
   re-included again on for a more specific form interface.
   [davisagli]
diff --git a/plone/directives/form/__init__.py b/plone/directives/form/__init__.py
index 07c97cb..87b769f 100644
--- a/plone/directives/form/__init__.py
+++ b/plone/directives/form/__init__.py
@@ -22,7 +22,7 @@
     pass
 
 # Further directives for Schema to influence form rendering. For example:
-# 
+#
 # >>> class IMyType(form.Schema)
 # ...     form.model('myschema.xml')
 # ...     form.widget(body='plone.app.z3cform.wysiwyg.WysiwygFieldWidget',)
@@ -35,7 +35,7 @@
 # ...     form.read_permission(field1='zope2.View')
 # ...     form.write_permission(field2='cmf.ModifyPortalContent')
 # ...     form.primary('field3')
-# 
+#
 # Here, the 'body' field will use a WYSIWYG widget; 'debug_field' and
 # 'extra_info' will be omitted from forms, except for form providing IEditForm;
 # the fields 'alpha' and 'beta' will go into a separate fieldset 'details';
@@ -53,20 +53,20 @@
 
 # Behavior interfaces can either be marked with or be adaptable to this
 # interface, in order to provide fields for the standard forms. For example:
-# 
+#
 # >>> class IMyBehavior(form.Schema):
 # ...     form.order_before(enabled='description')
 # ...     form.fieldset('tagging', label=u"Tagging", fields=['enabled', 'tags'])
-# ...     
+# ...
 # ...     enabled = schema.Bool(title=u"Tagging enabled", default=True)
-# ...     
+# ...
 # ...     tags = schema.List(title=u"Tags",
 # ...                        value_type=schema.Choice(values=["Tag 1", "Tag 2", "Tag 3"]))
-# ... 
+# ...
 # >>> alsoProvides(IMyBehavior, form.IFormFieldProvider)
-# 
+#
 # When this behavior (and its associated factory) is registered, any type
-# where the behavior (that uses the standard Dexterity form support) is 
+# where the behavior (that uses the standard Dexterity form support) is
 # enabled will have the appropriate form fields inserted.
 
 zope.deferredimport.defineFrom('plone.autoform.interfaces',
@@ -91,11 +91,11 @@
 
 # z3c.form value adapters for computed values: default_value (for a widget),
 # widget_label and button_label.
-# 
+#
 # >>> @default_value(field=IMySchema['some_field'])
 # ... def get_default(data):
 # ...     return data.context.Title().lower()
-# 
+#
 # See docstrings in value.py for more.
 
 zope.deferredimport.defineFrom('plone.directives.form.value',
@@ -103,7 +103,7 @@
 )
 
 # z3c.form widget validator adapters
-# 
+#
 # >>> @validator(field=IMySchema['some_field'])
 # ... def validateField(value):
 # ...     if value == 42:
@@ -114,7 +114,7 @@
 )
 
 # z3c.form error message computed value adapters
-# 
+#
 # >>> @error_message(error=TooSmall, field=IMySchema['some_field'])
 # ... def errorMessage(value):
 # ...     return u"The given value (%d) is too small" % value
diff --git a/plone/directives/form/error.py b/plone/directives/form/error.py
index 9f86596..ccc0fb3 100644
--- a/plone/directives/form/error.py
+++ b/plone/directives/form/error.py
@@ -4,28 +4,28 @@
 
 class error_message(object):
     """Decorator for functions which may return an error message.
-    
+
     The decorated function should take one argument, the value which caused
     the error, and return a message or unicode string::
-    
+
         @form.error_message(error=TooSmall, field=IMySchema['myfield'])
         def myFieldTooSmall(value):
             return u"Please make %d bigger" % value
     """
-    
+
     def __init__(self, **kw):
         self.discriminators = kw
-    
+
     def __call__(self, fn):
-        
+
         message = ComputedErrorViewMessage(fn, **self.discriminators)
-        
+
         frame = sys._getframe(1)
         adapters = frame.f_locals.get('__form_error_message_adapters__', None)
         if adapters is None:
             frame.f_locals['__form_error_message_adapters__'] = adapters = []
         adapters.append(message)
-        
+
         return fn
 
 __all__ = ('error_message',)
diff --git a/plone/directives/form/form.py b/plone/directives/form/form.py
index 93701e9..b584704 100644
--- a/plone/directives/form/form.py
+++ b/plone/directives/form/form.py
@@ -26,19 +26,19 @@
 class GrokkedForm(object):
     """Mixin class for all grokked forms, which provides grok.View-like
     semantics for template association, static resources, etc.
-    
+
     Do not use directly.
     """
     martian.baseclass()
-    
+
     # Emulate grokcore.view.View
-    
+
     def __init__(self, context, request):
         super(GrokkedForm, self).__init__(context, request)
-        
+
         # Set the view __name__
         self.__name__ = getattr(self, '__view_name__', None)
-        
+
         # Set up the view.static resource directory reference
         if getattr(self, 'module_info', None) is not None:
             self.static = zope.component.queryAdapter(
@@ -48,7 +48,7 @@ def __init__(self, context, request):
                 )
         else:
             self.static = None
-    
+
     def render(self):
         # Render a grok-style templat if we have one
         if (
@@ -59,11 +59,11 @@ def render(self):
         else:
             return super(GrokkedForm, self).render()
     render.base_method = True
-    
+
     @property
     def response(self):
         return self.request.response
-    
+
     def _render_template(self):
         return self.template.render(self)
 
@@ -77,7 +77,7 @@ def default_namespace(self):
 
     def namespace(self):
         return {}
-    
+
     def url(self, obj=None, name=None, data=None):
         """Return string for the URL based on the obj and name. The data
         argument is used to form a CGI query string.
@@ -107,18 +107,18 @@ def url(self, obj=None, name=None, data=None):
 
     def redirect(self, url):
         return self.request.response.redirect(url)
-    
+
     # BBB: makes the form have the most important properties that were
     # exposed by the wrapper view
-    
+
     @property
     def form_instance(self):
         return self
-    
+
     @property
     def form(self):
         return self.__class__
-    
+
 # Page forms
 
 class Form(GrokkedForm, z3c.form.form.Form):
@@ -130,7 +130,7 @@ class SchemaForm(plone.autoform.form.AutoExtensibleForm, Form):
     """A basic extensible form
     """
     martian.baseclass()
-    
+
     schema = None # Must be set by subclass
 
 # Add forms
@@ -139,27 +139,27 @@ class AddForm(GrokkedForm, z3c.form.form.AddForm):
     """A standard add form.
     """
     martian.baseclass()
-    
+
     immediate_view = None
-    
+
     def __init__(self, context, request):
         super(AddForm, self).__init__(context, request)
         self.request['disable_border'] = True
-    
+
     def render(self):
         if self._finishedAdd:
             self.request.response.redirect(self.nextURL())
             return ""
         return super(AddForm, self).render()
-    
+
     def nextURL(self):
         if self.immediate_view is not None:
             return self.immediate_view
         else:
             return self.context.absolute_url()
-    
+
     # Buttons
-    
+
     @z3c.form.button.buttonAndHandler(_('Save'), name='save')
     def handleAdd(self, action):
         data, errors = self.extractData()
@@ -171,11 +171,11 @@ def handleAdd(self, action):
             # mark only as finished if we get the new object
             self._finishedAdd = True
             IStatusMessage(self.request).addStatusMessage(_(u"Changes saved"), "info")
-    
+
     @z3c.form.button.buttonAndHandler(_(u'Cancel'), name='cancel')
     def handleCancel(self, action):
         IStatusMessage(self.request).addStatusMessage(_(u"Add New Item operation cancelled"), "info")
-        self.request.response.redirect(self.nextURL()) 
+        self.request.response.redirect(self.nextURL())
 
     def updateActions(self):
         super(AddForm, self).updateActions()
@@ -186,7 +186,7 @@ class SchemaAddForm(plone.autoform.form.AutoExtensibleForm, AddForm):
     """An extensible add form.
     """
     martian.baseclass()
-    
+
     schema = None # Must be set by subclass
 
 # Edit forms
@@ -195,7 +195,7 @@ class EditForm(GrokkedForm, z3c.form.form.EditForm):
     """A standard edit form
     """
     martian.baseclass()
-    
+
     @z3c.form.button.buttonAndHandler(_(u'Save'), name='save')
     def handleApply(self, action):
         data, errors = self.extractData()
@@ -205,12 +205,12 @@ def handleApply(self, action):
         self.applyChanges(data)
         IStatusMessage(self.request).addStatusMessage(_(u"Changes saved"), "info")
         self.request.response.redirect(self.context.absolute_url())
-    
+
     @z3c.form.button.buttonAndHandler(_(u'Cancel'), name='cancel')
     def handleCancel(self, action):
         IStatusMessage(self.request).addStatusMessage(_(u"Edit cancelled"), "info")
-        self.request.response.redirect(self.context.absolute_url()) 
-    
+        self.request.response.redirect(self.context.absolute_url())
+
     def updateActions(self):
         super(EditForm, self).updateActions()
         self.actions["save"].addClass("context")
@@ -220,7 +220,7 @@ class SchemaEditForm(plone.autoform.form.AutoExtensibleForm, EditForm):
     """An extensible edit form
     """
     martian.baseclass()
-    
+
     schema = None # Must be set by subclass
 
 # Display forms
@@ -230,11 +230,11 @@ class DisplayForm(plone.autoform.view.WidgetsView, five.grok.View):
     goodness of a grok.View, including automatic templates.
     """
     martian.baseclass()
-    
+
     def __init__(self, context, request):
         plone.autoform.view.WidgetsView.__init__(self, context, request)
-        five.grok.View.__init__(self, context, request)    
-    
+        five.grok.View.__init__(self, context, request)
+
     def render(self):
         template = getattr(self, 'template', None)
         if template is not None:
@@ -250,9 +250,9 @@ class wrap(martian.Directive):
     """
     scope = martian.CLASS
     store = martian.ONCE
-    
+
     def factory(self, flag=True):
         return flag
 
-__all__ = ('Form', 'SchemaForm', 'AddForm', 'SchemaAddForm', 
+__all__ = ('Form', 'SchemaForm', 'AddForm', 'SchemaAddForm',
             'EditForm', 'SchemaEditForm', 'DisplayForm', 'wrap',)
diff --git a/plone/directives/form/meta.py b/plone/directives/form/meta.py
index 62b1e9d..fbbde48 100644
--- a/plone/directives/form/meta.py
+++ b/plone/directives/form/meta.py
@@ -58,37 +58,37 @@ class FormGrokker(martian.ClassGrokker):
     them as views, using the same directives as other views. Note that
     templates are *not* automatically assigned.
     """
-    
+
     martian.component(GrokkedForm)
-    
+
     martian.directive(grokcore.component.context)
     martian.directive(grokcore.view.layer, default=IDefaultBrowserLayer)
     martian.directive(grokcore.component.name, get_default=default_view_name)
     martian.directive(grokcore.security.require, name='permission', default=None)
     martian.directive(wrap, default=None)
-    
+
     default_permissions = {
         EditForm          : 'cmf.ModifyPortalContent',
         SchemaEditForm    : 'cmf.ModifyPortalContent',
         AddForm           : 'cmf.AddPortalContent',
         SchemaAddForm     : 'cmf.AddPortalContent',
     }
-    
+
     permission_fallback = 'zope2.View'
-    
+
     def grok(self, name, form, module_info, **kw):
         # save the module info so that we can look for templates later
         form.module_info = module_info
         return super(FormGrokker, self).grok(name, form, module_info, **kw)
-    
+
     def execute(self, form, config, context, layer, name, permission, wrap, **kw):
-        
+
         if permission is None:
             permission = self.default_permissions.get(form.__class__, self.permission_fallback)
 
         if issubclass(form, AutoExtensibleForm):
             if getattr(form, 'schema', None) is None:
-                
+
                 if issubclass(form, (EditForm, Form)) and IInterface.providedBy(context):
                     form.schema = context
                 else:
@@ -97,19 +97,19 @@ def execute(self, form, config, context, layer, name, permission, wrap, **kw):
                           "defining a schema interface for the form. If you want "
                           "to set up your fields manually, use a non-schema form "
                           "base class instead." % (form.__name__))
-        
+
         form.__view_name__ = name
-        
+
         if wrap is None:
             wrap = DEFAULT_WRAP
-        
+
         # Only use the wrapper view if we are on Zope < 2.12
         if wrap:
             factory = wrap_form(form)
             factory.__view_name__ = name
         else:
             factory = form
-        
+
         page_directive(
                 config,
                 name=name,
@@ -118,21 +118,21 @@ def execute(self, form, config, context, layer, name, permission, wrap, **kw):
                 layer=layer,
                 class_=factory
             )
-        
+
         return True
-    
+
 
 class DisplayFormGrokker(martian.ClassGrokker):
     """Let a display form use its context as an implicit schema, if the
     context has been set.
     """
-    
+
     martian.component(DisplayForm)
-    
+
     martian.directive(grokcore.component.context)
-    
+
     def execute(self, factory, config, context, **kw):
-        
+
         if getattr(factory, 'schema', None) is None and \
                 IInterface.providedBy(context):
             factory.schema = context
@@ -144,7 +144,7 @@ def execute(self, factory, config, context, **kw):
 # Value adapter grokker
 
 class ValueAdapterGrokker(martian.GlobalGrokker):
-    
+
     def grok(self, name, module, module_info, config, **kw):
         # context = grokcore.component.context.bind().get(module=module)
         adapters = module_info.getAnnotation('form.value_adapters', [])
@@ -158,7 +158,7 @@ def grok(self, name, module, module_info, config, **kw):
 # Validator adapter grokker
 
 class ValidatorAdapterGrokker(martian.GlobalGrokker):
-    
+
     def grok(self, name, module, module_info, config, **kw):
         # context = grokcore.component.context.bind().get(module=module)
         adapters = module_info.getAnnotation('form.validator_adapters', [])
@@ -171,7 +171,7 @@ def grok(self, name, module, module_info, config, **kw):
 # Error message adapter grokker
 
 class ErrorMessageAdapterGrokker(martian.GlobalGrokker):
-    
+
     def grok(self, name, module, module_info, config, **kw):
         # context = grokcore.component.context.bind().get(module=module)
         adapters = module_info.getAnnotation('form.error_message_adapters', [])
diff --git a/plone/directives/form/tests/schema.txt b/plone/directives/form/tests/schema.txt
index 7b66e26..f3db67f 100644
--- a/plone/directives/form/tests/schema.txt
+++ b/plone/directives/form/tests/schema.txt
@@ -2,7 +2,7 @@
 Loading plone.supermodel schemata from XML files
 ================================================
 
-BBB Note: The directives discussed in this document were moved to 
+BBB Note: The directives discussed in this document were moved to
 plone.supermodel. This document remains for the time being to test backwards
 compatibility.
 
@@ -21,11 +21,11 @@ First, load this package's configuration:
     ... <configure
     ...      xmlns="http://namespaces.zope.org/zope"
     ...      i18n_domain="plone.behavior.tests">
-    ...      
+    ...
     ...     <include package="Products.Five" file="configure.zcml" />
-    ...     
+    ...
     ...     <include package="plone.directives.form" />
-    ...     
+    ...
     ... </configure>
     ... """
 
@@ -58,7 +58,7 @@ on how this is structured.
     ...             <max_length>10000</max_length>
     ...         </field>
     ...     </schema>
-    ...     
+    ...
     ...     <schema name="metadata">
     ...         <field type="zope.schema.Datetime" name="created">
     ...             <title>Created date</title>
@@ -70,7 +70,7 @@ on how this is structured.
     ...             <required>True</required>
     ...         </field>
     ...     </schema>
-    ...     
+    ...
     ... </model>
     ... """
 
@@ -88,8 +88,8 @@ We can now define a schema, using the directives defined in this package:
     >>> from plone.directives import form
     >>> class ITestContent(form.Schema):
     ...     form.model(schema_filename)
-    
-Note: If the schema filename is not an absolute path, it will be found 
+
+Note: If the schema filename is not an absolute path, it will be found
 relative to the module where the interface is defined.
 
 The interface should have the fields of the default (unnamed)
@@ -99,7 +99,7 @@ schema:
     >>> getFieldNamesInOrder(ITestContent)
     ['title', 'body']
 
-It also contains the filename that the schema was loaded from and the schema 
+It also contains the filename that the schema was loaded from and the schema
 name as a tagged values in the base interface.
 
     >>> from plone.supermodel.interfaces import FILENAME_KEY, SCHEMA_NAME_KEY
@@ -135,13 +135,13 @@ former will override the latter.
     >>> import zope.schema
     >>> class ITestContentWithNewFields(form.Schema):
     ...     form.model(schema_filename)
-    ...     
+    ...
     ...     title = zope.schema.TextLine(title=u"Title", default=u"Default title")
     ...     postscript = zope.schema.Text(title=u"Postscript")
-    
+
     >>> getFieldNamesInOrder(ITestContentWithNewFields)
     ['body', 'title', 'postscript']
-    
+
     >>> ITestContentWithNewFields[u'title'].default
     u'Default title'
 
@@ -155,23 +155,23 @@ fieldsets. The same tagged value can be populated using a directive:
     ...
     ...     form.fieldset(u"default", label="Default", fields=['title', 'description'])
     ...     form.fieldset(u"metadata", label="Metadata", fields=['publication_date'], layout='concise')
-    ...     
+    ...
     ...     title = zope.schema.TextLine(title=u"Title")
     ...     description = zope.schema.TextLine(title=u"Description")
-    ...     
+    ...
     ...     publication_date = zope.schema.Date(title=u"Publication date")
 
     >>> from plone.supermodel.interfaces import FIELDSETS_KEY
     >>> IGrouped.getTaggedValue(FIELDSETS_KEY)
     [<Fieldset 'default' of title, description>, <Fieldset 'metadata' of publication_date>]
-    
+
 Extra parameters, such as the layout parameter for the metadata fieldset, are
 accessible as attributes on the fieldset:
 
     >>> metadata = IGrouped.getTaggedValue(FIELDSETS_KEY)[1]
     >>> metadata.layout
     'concise'
-    
+
 Cleanup
 -------
 
diff --git a/plone/directives/form/tests/test_error.py b/plone/directives/form/tests/test_error.py
index 3e6129b..a624ff4 100644
--- a/plone/directives/form/tests/test_error.py
+++ b/plone/directives/form/tests/test_error.py
@@ -23,7 +23,7 @@ class IFolder2(Interface):
     pass
 
 class IDummySchema(Interface):
-    
+
     field1 = schema.Int(title=u"Field one", min=10, required=True)
     field2 = schema.Int(title=u"Field two", min=10, required=False)
 
@@ -34,12 +34,12 @@ class Folder2(object):
     implements(IFolder2)
 
 class DummyForm(Form):
-    
+
     ignoreContext = True
     fields = Fields(IDummySchema)
 
 class DummySecondaryForm(Form):
-    
+
     ignoreContext = True
     fields = Fields(IDummySchema)
 
@@ -60,48 +60,48 @@ class TestErrorMessageDecorator(unittest.TestCase):
 
     def setUp(self):
         setupFormDefaults()
-        
+
         grok('plone.directives.form.meta')
         grok('plone.directives.form.tests.test_error')
-        
+
     def tearDown(self):
         zope.component.testing.tearDown()
-        
+
     def test_error_message_no_error(self):
-        
+
         form = DummyForm(Folder(), TestRequest(form={'form.widgets.field1': u"10"}))
         form.update()
-        
+
         data, errors = form.extractData()
         self.assertEquals(0, len(errors))
-    
+
     def test_error_message_field_only(self):
-        
+
         form = DummyForm(Folder(), TestRequest(form={'form.widgets.field1': u"5"}))
         form.update()
-        
+
         data, errors = form.extractData()
         self.assertEquals(1, len(errors))
         self.assertEquals(u"Field 1 error", errors[0].message)
 
     def test_error_message_field_view(self):
-        
+
         form = DummySecondaryForm(Folder(), TestRequest(form={'form.widgets.field1': u"5"}))
         form.update()
-        
+
         data, errors = form.extractData()
         self.assertEquals(1, len(errors))
         self.assertEquals(u"Field 1 error second form", errors[0].message)
-    
+
     def test_error_message_field_context(self):
-        
+
         form = DummyForm(Folder2(), TestRequest(form={'form.widgets.field1': u"5"}))
         form.update()
-        
+
         data, errors = form.extractData()
         self.assertEquals(1, len(errors))
         self.assertEquals(u"Field 1 error context", errors[0].message)
-    
+
     def test_method_not_changed(self):
         self.assertEquals(u"Field 1 error", field1Error(None))
 
diff --git a/plone/directives/form/tests/test_form.py b/plone/directives/form/tests/test_form.py
index 1e69642..2752a5e 100644
--- a/plone/directives/form/tests/test_form.py
+++ b/plone/directives/form/tests/test_form.py
@@ -31,12 +31,12 @@ class IDummy2(Interface):
 
 class Dummy(object):
     implements(IDummy)
-    
+
     def absolute_url(self):
         return "http://dummy"
 
 class Request(TestRequest):
-    
+
     # Zope 2 requests have this
     def __setitem__(self, name, value):
         self._environ[name] = value
@@ -48,11 +48,11 @@ def __setitem__(self, name, value):
 class TestFormDirectives(unittest.TestCase):
 
     def setUp(self):
-        
+
         # On Zope 2.10, the default is True, on 2.12 it's False
         self.defaultWrap = plone.directives.form.meta.DEFAULT_WRAP
         plone.directives.form.meta.DEFAULT_WRAP = False
-        
+
         grokcore.component.testing.grok('grokcore.component.meta')
         grokcore.component.testing.grok('grokcore.security.meta')
         grokcore.component.testing.grok('grokcore.view.meta.templates')
@@ -60,301 +60,301 @@ def setUp(self):
         grokcore.component.testing.grok('grokcore.view.meta.skin')
         grokcore.component.testing.grok('five.grok.meta')
         grokcore.component.testing.grok('plone.directives.form.meta')
-        
+
         grokcore.component.testing.grok('grokcore.view.templatereg')
-        
+
         provideUtility(Permission('zope2.View'), name='zope2.View')
         provideUtility(Permission('cmf.ModifyPortalContent'), name='cmf.ModifyPortalContent')
         provideUtility(Permission('cmf.AddPortalContent'), name='cmf.AddPortalContent')
-    
+
     def tearDown(self):
         zope.component.testing.tearDown()
         plone.directives.form.meta.DEFAULT_WRAP = self.defaultWrap
-    
+
     def test_form_grokker_with_directives(self):
-        
+
         class TestForm(form.Form):
             grok.context(IDummy)
             grok.name('my-test-form')
             grok.layer(ILayer)
             grok.require('zope2.View')
-        
+
         grokcore.component.testing.grok_component('TestForm', TestForm)
-        
+
         context = Dummy()
         request = Request()
         alsoProvides(request, ILayer)
-        
+
         view = getMultiAdapter((context, request), name="my-test-form")
-        
+
         self.failUnless(issubclass(view.form, TestForm))
 
     def test_grokker_with_defaults(self):
-        
+
         class TestForm(form.Form):
             grok.context(IDummy)
-        
+
         grokcore.component.testing.grok_component('TestForm', TestForm)
-        
+
         context = Dummy()
         request = Request()
-        
+
         view = getMultiAdapter((context, request), name="testform")
-        
+
         self.failUnless(issubclass(view.form, TestForm))
 
     def test_schema_form(self):
-        
+
         class TestForm(form.SchemaForm):
             grok.context(IDummy)
             schema = IDummy2
-            
+
         grokcore.component.testing.grok_component('TestForm', TestForm)
-        
+
         context = Dummy()
         request = Request()
-        
+
         view = getMultiAdapter((context, request), name="testform")
-        
+
         self.failUnless(issubclass(view.form, TestForm))
         self.assertEquals(IDummy2, view.form.schema)
-    
+
     def test_schema_form_implicit_schema(self):
-        
+
         class TestForm(form.SchemaForm):
             grok.context(IDummy)
-        
+
         grokcore.component.testing.grok_component('TestForm', TestForm)
-        
+
         context = Dummy()
         request = Request()
-        
+
         view = getMultiAdapter((context, request), name="testform")
-        
+
         self.failUnless(issubclass(view.form, TestForm))
         self.assertEquals(IDummy, view.form.schema)
-        
+
     def test_add_form(self):
-        
+
         class TestForm(form.AddForm):
             grok.context(IDummy)
-        
+
         grokcore.component.testing.grok_component('TestForm', TestForm)
-        
+
         context = Dummy()
         request = Request()
-        
+
         view = getMultiAdapter((context, request), name="testform")
-        
+
         self.failUnless(issubclass(view.form, TestForm))
-        
+
         self.assertEquals("http://dummy", view.form_instance    .nextURL())
         view.form_instance.immediate_view = "http://other_view"
         self.assertEquals("http://other_view", view.form_instance.nextURL())
 
     def test_schema_add_form(self):
-        
+
         class TestForm(form.SchemaAddForm):
             grok.context(IDummy)
             schema = IDummy2
-        
+
         grokcore.component.testing.grok_component('TestForm', TestForm)
-        
+
         context = Dummy()
         request = Request()
-        
+
         view = getMultiAdapter((context, request), name="testform")
-        
+
         self.failUnless(issubclass(view.form, TestForm))
         self.assertEquals(IDummy2, view.form.schema)
-    
+
     # Note: No implicit schema-from-context here, since context of add form
     #  is container.
-    
+
     def test_edit_form(self):
-        
+
         class TestForm(form.EditForm):
             grok.context(IDummy)
-        
+
         grokcore.component.testing.grok_component('TestForm', TestForm)
-        
+
         context = Dummy()
         request = Request()
-        
+
         view = getMultiAdapter((context, request), name="testform")
-        
+
         self.failUnless(issubclass(view.form, TestForm))
 
     def test_schema_edit_form(self):
-        
+
         class TestForm(form.SchemaEditForm):
             grok.context(IDummy)
             schema = IDummy2
-        
+
         grokcore.component.testing.grok_component('TestForm', TestForm)
-        
+
         context = Dummy()
         request = Request()
-        
+
         view = getMultiAdapter((context, request), name="testform")
-        
+
         self.failUnless(issubclass(view.form, TestForm))
         self.assertEquals(IDummy2, view.form.schema)
-        
+
     def test_schema_edit_form_implicit_schema(self):
-        
+
         class TestForm(form.SchemaEditForm):
             grok.context(IDummy)
-        
+
         grokcore.component.testing.grok_component('TestForm', TestForm)
-        
+
         context = Dummy()
         request = Request()
-        
+
         view = getMultiAdapter((context, request), name="testform")
-        
+
         self.failUnless(issubclass(view.form, TestForm))
         self.assertEquals(IDummy, view.form.schema)
 
     def test_display_form_with_schema(self):
-        
+
         # Note: We're not testing view registration, since that is done
         # by the standard five.grok View grokker
-        
+
         class TestForm(form.DisplayForm):
             grok.context(IDummy)
             schema = IDummy2
-            
+
         grokcore.component.testing.grok_component('TestForm', TestForm)
-        
+
         self.assertEquals(IDummy2, TestForm.schema)
-    
+
     def test_display_form_implicit_schema(self):
 
         # Note: We're not testing view registration, since that is done
         # by the standard five.grok View grokker
-        
+
         class TestForm(form.DisplayForm):
             grok.context(IDummy)
-        
+
         grokcore.component.testing.grok_component('TestForm', TestForm)
-        
+
         self.assertEquals(IDummy, TestForm.schema)
-    
+
     def test_wrap(self):
-        
+
         class TestForm(form.Form):
             grok.context(IDummy)
             form.wrap()
-        
+
         grokcore.component.testing.grok_component('TestForm', TestForm)
-        
+
         context = Dummy()
         request = Request()
-        
+
         view = getMultiAdapter((context, request), name="testform")
-        
+
         self.failUnless(issubclass(view.form, TestForm))
         self.failUnless(isinstance(view, FormWrapper))
-    
+
     def test_wrap_false(self):
-        
+
         class TestForm(form.Form):
             grok.context(IDummy)
             form.wrap(False)
-        
+
         grokcore.component.testing.grok_component('TestForm', TestForm)
-        
+
         context = Dummy()
         request = Request()
-        
+
         view = getMultiAdapter((context, request), name="testform")
-        
+
         self.failUnless(issubclass(view.form, TestForm))
         self.failUnless(isinstance(view, TestForm))
-    
+
     def test_nowrap(self):
-        
+
         class TestForm(form.Form):
             grok.context(IDummy)
             form.wrap(False)
-        
+
         grokcore.component.testing.grok_component('TestForm', TestForm)
-        
+
         context = Dummy()
         request = Request()
-        
+
         view = getMultiAdapter((context, request), name="testform")
-        
+
         self.failUnless(issubclass(view.form, TestForm))
         self.failUnless(isinstance(view, TestForm))
-    
+
     def test_wrap_default(self):
-        
+
         # Simulate Zope 2.10 default
         plone.directives.form.meta.DEFAULT_WRAP = True
-        
+
         class TestForm(form.Form):
             grok.context(IDummy)
-        
+
         grokcore.component.testing.grok_component('TestForm', TestForm)
-        
+
         context = Dummy()
         request = Request()
-        
+
         view = getMultiAdapter((context, request), name="testform")
-        
+
         self.failUnless(issubclass(view.form, TestForm))
         self.failUnless(isinstance(view, FormWrapper))
-    
+
     def test_wrap_default_wrap_false(self):
         # Simulate Zope 2.10 default
         plone.directives.form.meta.DEFAULT_WRAP = True
-        
+
         class TestForm(form.Form):
             grok.context(IDummy)
             form.wrap(False)
-        
+
         grokcore.component.testing.grok_component('TestForm', TestForm)
-        
+
         context = Dummy()
         request = Request()
-        
+
         view = getMultiAdapter((context, request), name="testform")
-        
+
         self.failUnless(issubclass(view.form, TestForm))
         self.failUnless(isinstance(view, TestForm))
-    
+
     def test_template(self):
-        
+
         class TestFormWithTemplate(form.Form):
             grok.context(IDummy)
-        
+
         grokcore.component.testing.grok(__name__)
-        
+
         grokcore.component.testing.grok_component('TestFormWithTemplate', TestFormWithTemplate)
-        
+
         context = Dummy()
         request = Request()
-        
+
         view = getMultiAdapter((context, request), name="testformwithtemplate")
-        
+
         self.failUnless(issubclass(view.form, TestFormWithTemplate))
         self.failUnless(grokcore.view.interfaces.ITemplate.providedBy(view.template))
-    
+
     def test_template_and_render(self):
-        
+
         class TestFormWithTemplate(form.Form):
             grok.context(IDummy)
-            
+
             def render(self):
                 return u"My custom renderer"
-        
+
         grokcore.component.testing.grok(__name__)
-        
+
         self.assertRaises(ConfigurationExecutionError,
             grokcore.component.testing.grok_component,
             'TestFormWithTemplate', TestFormWithTemplate)
-    
+
 def test_suite():
     return unittest.defaultTestLoader.loadTestsFromName(__name__)
diff --git a/plone/directives/form/tests/test_schema.py b/plone/directives/form/tests/test_schema.py
index ba3741a..69b2193 100644
--- a/plone/directives/form/tests/test_schema.py
+++ b/plone/directives/form/tests/test_schema.py
@@ -27,25 +27,25 @@ class TestSchemaDirectives(unittest.TestCase):
     def setUp(self):
         configuration = """\
         <configure xmlns="http://namespaces.zope.org/zope">
-        
+
             <include package="Products.Five" file="configure.zcml" />
             <include package="plone.directives.form" />
-        
+
         </configure>
         """
         from StringIO import StringIO
         from zope.configuration import xmlconfig
         xmlconfig.xmlconfig(StringIO(configuration))
-        
+
         grok('plone.directives.form.meta')
 
     def tearDown(self):
         zope.component.testing.tearDown()
-    
+
     def test_schema_directives_store_tagged_values(self):
-        
+
         class IDummy(form.Schema):
-            
+
             form.omitted('foo', 'bar')
             form.omitted(form.Schema, 'qux')
             form.no_omit(form.Schema, 'bar')
@@ -56,12 +56,12 @@ class IDummy(form.Schema):
             form.order_after(qux='title')
             form.read_permission(foo='zope2.View')
             form.write_permission(foo='cmf.ModifyPortalContent')
-            
+
             foo = zope.schema.TextLine(title=u"Foo")
             bar = zope.schema.TextLine(title=u"Bar")
             baz = zope.schema.TextLine(title=u"Baz")
             qux = zope.schema.TextLine(title=u"Qux")
-            
+
         self.assertEquals({'foo': 'some.dummy.Widget',
                            'baz': 'other.Widget'},
                           IDummy.queryTaggedValue(WIDGETS_KEY))
@@ -80,24 +80,24 @@ class IDummy(form.Schema):
                           IDummy.queryTaggedValue(READ_PERMISSIONS_KEY))
         self.assertEquals({'foo': 'cmf.ModifyPortalContent'},
                           IDummy.queryTaggedValue(WRITE_PERMISSIONS_KEY))
-                                  
+
     def test_widget_supports_instances_and_strings(self):
-        
+
         class IDummy(form.Schema):
-            
+
             form.widget(foo=DummyWidget)
-            
+
             foo = zope.schema.TextLine(title=u"Foo")
             bar = zope.schema.TextLine(title=u"Bar")
             baz = zope.schema.TextLine(title=u"Baz")
-            
+
         self.assertEquals({'foo': 'plone.directives.form.tests.test_schema.DummyWidget'},
                   IDummy.queryTaggedValue(WIDGETS_KEY))
-        
+
     def test_multiple_invocations(self):
-        
+
         class IDummy(form.Schema):
-            
+
             form.omitted('foo')
             form.omitted('bar')
             form.widget(foo='some.dummy.Widget')
@@ -112,12 +112,12 @@ class IDummy(form.Schema):
             form.read_permission(baz='random.Permission')
             form.write_permission(foo='cmf.ModifyPortalContent')
             form.write_permission(baz='another.Permission')
-            
+
             foo = zope.schema.TextLine(title=u"Foo")
             bar = zope.schema.TextLine(title=u"Bar")
             baz = zope.schema.TextLine(title=u"Baz")
             qux = zope.schema.TextLine(title=u"Qux")
-            
+
         self.assertEquals({'foo': 'some.dummy.Widget',
                            'baz': 'other.Widget'},
                           IDummy.queryTaggedValue(WIDGETS_KEY))
@@ -136,26 +136,26 @@ class IDummy(form.Schema):
                           IDummy.queryTaggedValue(READ_PERMISSIONS_KEY))
         self.assertEquals({'foo': 'cmf.ModifyPortalContent', 'baz': 'another.Permission'},
                           IDummy.queryTaggedValue(WRITE_PERMISSIONS_KEY))
-    
+
     def test_primary_field(self):
-        
+
         class IDummy(form.Schema):
-            
+
             form.primary('foo')
             form.primary('bar', 'baz')
-            
+
             foo = zope.schema.TextLine(title=u"Foo")
             bar = zope.schema.TextLine(title=u"Bar")
             baz = zope.schema.TextLine(title=u"Baz")
             qux = zope.schema.TextLine(title=u"Qux")
-            
+
         self.failUnless(IPrimaryField.providedBy(IDummy['foo']))
         self.failUnless(IPrimaryField.providedBy(IDummy['bar']))
         self.failUnless(IPrimaryField.providedBy(IDummy['baz']))
         self.failIf(IPrimaryField.providedBy(IDummy['qux']))
-    
+
     def test_misspelled_field(self):
-        
+
         try:
             class IFoo(form.Schema):
                 form.primary('fou')
@@ -164,7 +164,7 @@ class IFoo(form.Schema):
             pass
         else:
             self.fail('Did not raise ValueError')
-        
+
         try:
             class IBar(form.Schema):
                 form.order_before(ber='*')
@@ -184,24 +184,24 @@ class IBaz(form.Schema):
             self.fail('Did not raise ValueError')
 
     def test_derived_class_fields(self):
-        
+
         class IFoo(form.Schema):
             foo = zope.schema.TextLine()
-        
+
         class IBar(IFoo):
             form.order_after(foo='bar')
             bar = zope.schema.TextLine()
-        
+
         self.assertEquals([('foo', 'after', 'bar'),], IBar.queryTaggedValue(ORDER_KEY))
-    
+
     def test_schema_without_model_not_grokked(self):
-        
+
         class IFoo(Schema):
             pass
-            
+
         self.assertEquals(None, IFoo.queryTaggedValue(FILENAME_KEY))
         self.assertEquals(None, IFoo.queryTaggedValue(SCHEMA_NAME_KEY))
-    
+
 def test_suite():
     return unittest.TestSuite((
         unittest.makeSuite(TestSchemaDirectives),
diff --git a/plone/directives/form/tests/test_validator.py b/plone/directives/form/tests/test_validator.py
index 89df1ef..1c925e9 100644
--- a/plone/directives/form/tests/test_validator.py
+++ b/plone/directives/form/tests/test_validator.py
@@ -21,7 +21,7 @@ class IFolder2(Interface):
     pass
 
 class IDummySchema(Interface):
-    
+
     field1 = schema.TextLine(title=u"Field one", required=True)
     field2 = schema.TextLine(title=u"Field two", required=False)
 
@@ -32,12 +32,12 @@ class Folder2(object):
     implements(IFolder2)
 
 class DummyForm(Form):
-    
+
     ignoreContext = True
     fields = Fields(IDummySchema)
 
 class DummySecondaryForm(Form):
-    
+
     ignoreContext = True
     fields = Fields(IDummySchema)
 
@@ -60,57 +60,57 @@ class TestValidatorDecorator(unittest.TestCase):
 
     def setUp(self):
         setupFormDefaults()
-        
+
         grok('plone.directives.form.meta')
         grok('plone.directives.form.tests.test_validator')
-        
+
     def tearDown(self):
         zope.component.testing.tearDown()
-        
+
     def test_validator_calls_default(self):
-        
+
         form = DummyForm(Folder(), TestRequest())
         form.update()
-        
+
         data, errors = form.extractData()
         self.assertEquals(1, len(errors))
         self.assertEquals(u"Required input is missing.", errors[0].error.doc())
-    
+
     def test_validator_no_error(self):
-        
+
         form = DummyForm(Folder(), TestRequest(form={'form.widgets.field1': u"Value"}))
         form.update()
-        
+
         data, errors = form.extractData()
         self.assertEquals(0, len(errors))
-    
+
     def test_validator_field_only(self):
-        
+
         form = DummyForm(Folder(), TestRequest(form={'form.widgets.field1': u"fail"}))
         form.update()
-        
+
         data, errors = form.extractData()
         self.assertEquals(1, len(errors))
         self.assertEquals(u"Field 1, form 1", errors[0].error.args[0])
-    
+
     def test_validator_field_view(self):
-        
+
         form = DummySecondaryForm(Folder(), TestRequest(form={'form.widgets.field1': u"fail"}))
         form.update()
-        
+
         data, errors = form.extractData()
         self.assertEquals(1, len(errors))
         self.assertEquals(u"Field 1, form 2", errors[0].error.args[0])
-    
+
     def test_validator_field_context(self):
-        
+
         form = DummyForm(Folder2(), TestRequest(form={'form.widgets.field1': u"fail"}))
         form.update()
-        
+
         data, errors = form.extractData()
         self.assertEquals(1, len(errors))
         self.assertEquals(u"Field 1, context", errors[0].error.args[0])
-    
+
     def test_method_not_changed(self):
         self.assertEquals(None, validate_field1(None))
         self.assertRaises(schema.ValidationError, validate_field1, 'fail')
diff --git a/plone/directives/form/tests/test_value.py b/plone/directives/form/tests/test_value.py
index a0b0fb2..6b0f93d 100644
--- a/plone/directives/form/tests/test_value.py
+++ b/plone/directives/form/tests/test_value.py
@@ -18,7 +18,7 @@ class IFolder(Interface):
     pass
 
 class IDummySchema(Interface):
-    
+
     field1 = schema.TextLine(title=u"Field one")
     field2 = schema.TextLine(title=u"Field two")
 
@@ -27,22 +27,22 @@ class Folder(object):
 
 class Dummy(object):
     implements(IDummySchema)
-    
+
     field1 = u"Field 1 default"
     field2 = u""
 
 class DummyEditForm(EditForm):
-    
+
     fields = Fields(IDummySchema)
 
 class DummyAddForm(AddForm):
-    
+
     fields = Fields(IDummySchema)
 
 class DummySecondaryAddForm(AddForm):
-    
+
     fields = Fields(IDummySchema)
-    
+
 @form.default_value(field=IDummySchema['field1'])
 def field1_default(data):
     return u"A dummy"
@@ -58,7 +58,7 @@ def field1_label(data):
 @form.button_label(button=EditForm.buttons['apply'])
 def apply_button_label(data):
     return u"Computed label"
-    
+
 @form.button_label(button=DummySecondaryAddForm.buttons['add'], form=DummySecondaryAddForm)
 def add_button_secondary(data):
     return u"Computed add button"
@@ -67,56 +67,56 @@ class TestValueDecorators(unittest.TestCase):
 
     def setUp(self):
         setupFormDefaults()
-        
+
         grok('plone.directives.form.meta')
         grok('plone.directives.form.tests.test_value')
-        
+
     def tearDown(self):
         zope.component.testing.tearDown()
-        
+
     def test_default_value(self):
-        
+
         add_form = DummyAddForm(Folder(), TestRequest())
         add_form.update()
         self.assertEquals(u"A dummy", add_form.widgets['field1'].value)
-        
+
         edit_form = DummyEditForm(Dummy(), TestRequest())
         edit_form.update()
         self.assertEquals(u"Field 1 default", edit_form.widgets['field1'].value)
-        
+
         secondary_add_form = DummySecondaryAddForm(Folder(), TestRequest())
         secondary_add_form.update()
         self.assertEquals(u"Another dummy", secondary_add_form.widgets['field1'].value)
-    
+
     def test_widget_label(self):
-        
+
         add_form = DummyAddForm(Folder(), TestRequest())
         add_form.update()
         self.assertEquals(u"Field one", add_form.widgets['field1'].label)
         self.assertEquals(u"Field two", add_form.widgets['field2'].label)
-        
+
         edit_form = DummyEditForm(Dummy(), TestRequest())
         edit_form.update()
         self.assertEquals(u"A label", edit_form.widgets['field1'].label)
         self.assertEquals(u"Field two", edit_form.widgets['field2'].label)
 
     def test_button_label(self):
-        
+
         add_form = DummyAddForm(Folder(), TestRequest())
         add_form.update()
         self.assertEquals(u"Add", add_form.actions['add'].title)
-        
+
         secondary_add_form = DummySecondaryAddForm(Folder(), TestRequest())
         secondary_add_form.update()
         self.assertEquals(u"Computed add button", secondary_add_form.actions['add'].title)
-        
+
         edit_form = DummyEditForm(Dummy(), TestRequest())
         edit_form.update()
         self.assertEquals(u"Computed label", edit_form.actions['apply'].title)
-    
+
     def test_method_not_changed(self):
         self.assertEquals(u"Computed add button", add_button_secondary(None))
-    
+
 def test_suite():
     return unittest.TestSuite((
         unittest.makeSuite(TestValueDecorators),
diff --git a/plone/directives/form/validator.py b/plone/directives/form/validator.py
index 79202f8..6e9e56a 100644
--- a/plone/directives/form/validator.py
+++ b/plone/directives/form/validator.py
@@ -7,11 +7,11 @@
 from z3c.form.validator import WidgetValidatorDiscriminators
 
 class DecoratedValidator(SimpleFieldValidator):
-    
+
     def __init__(self, fn, context, request, view, field, widget):
         super(DecoratedValidator, self).__init__(context, request, view, field, widget)
         self.fn = fn
-    
+
     def validate(self, value):
         super(DecoratedValidator, self).validate(value)
         self.fn(value)
@@ -19,24 +19,24 @@ def validate(self, value):
 class validator(object):
     """Decorator for functions to be registered as validators
     """
-    
+
     def __init__(self, **kw):
         self.discriminators = kw
-    
+
     def __call__(self, fn):
-        
+
         @implementer(IValidator)
         def factory(context, request, view, field, widget):
             return DecoratedValidator(fn, context, request, view, field, widget)
-        
+
         WidgetValidatorDiscriminators(factory, **self.discriminators)
-        
+
         frame = sys._getframe(1)
         adapters = frame.f_locals.get('__form_validator_adapters__', None)
         if adapters is None:
             frame.f_locals['__form_validator_adapters__'] = adapters = []
         adapters.append(factory)
-        
+
         return fn
 
 __all__ = ('validator',)
diff --git a/plone/directives/form/value.py b/plone/directives/form/value.py
index 5ce963f..c32aa4a 100644
--- a/plone/directives/form/value.py
+++ b/plone/directives/form/value.py
@@ -6,60 +6,60 @@
 class _computed_value(object):
     """Decorator for things using z3c.form.value IValue creators.
     """
-    
+
     # should be set by subclass
     factory = None
-    
+
     def __init__(self, name, **kw):
         self.name = name
         self.discriminators = kw
-    
+
     def __call__(self, ob):
-        
+
         try:
             value_adapter = (self.factory(ob, **self.discriminators), self.name,)
         except ValueError, e:
             raise ValueError(u"Error constructing value adapter for %s: %s" % (str(ob), str(e),))
-        
+
         frame = sys._getframe(1)
         adapters = frame.f_locals.get('__form_value_adapters__', None)
         if adapters is None:
             frame.f_locals['__form_value_adapters__'] = adapters = []
         adapters.append(value_adapter)
-        
+
         return ob
 
 class default_value(_computed_value):
     """Decorator for functions providing a default field value when rendering
     a form::
-    
+
         @default_value(field=IMySchema['my_field'])
         def get_default(data):
             return ...
-    
+
     The 'data' object has attributes context, request (layer), view (form),
     field, and widget. These are also the possible discriminators that can be
     passed to the decorator. Either 'field' or 'widget' must be specified.
     """
-    
+
     factory = ComputedWidgetAttribute
-    
+
     def __init__(self, context=None, request=None, view=None, field=None, widget=None, form=None, layer=None):
-        
+
         if not field and not widget:
             raise TypeError(u"Either 'field' or 'widget' must be specified")
-        
+
         if form and view:
             raise TypeError(u"You cannot specify both 'view' and 'form' - one is an alias for the other")
         elif form and not view:
             view = form
-            
+
         if request and layer:
             raise TypeError(u"You cannot specify both 'request' and 'layer' - one is an alias for the other")
         elif layer and not request:
             request = layer
-        
-        super(default_value, self).__init__('default', 
+
+        super(default_value, self).__init__('default',
                 context=context,
                 request=request,
                 view=view,
@@ -69,34 +69,34 @@ def __init__(self, context=None, request=None, view=None, field=None, widget=Non
 
 class widget_label(_computed_value):
     """Decorator for functions providing a computed widget label::
-    
+
         @widget_label(field=IMySchema['my_field'])
         def get_widget(data):
             return ...
-    
+
     The 'data' object has attributes context, request (layer), view (form),
     field, and widget. These are also the possible discriminators that can be
     passed to the decorator. Either 'field' or 'widget' must be specified.
     """
-    
+
     factory = ComputedWidgetAttribute
-    
+
     def __init__(self, context=None, request=None, view=None, field=None, widget=None, form=None, layer=None):
-        
+
         if not field and not widget:
             raise TypeError(u"Either 'field' or 'widget' must be specified")
-        
+
         if form and view:
             raise TypeError(u"You cannot specify both 'view' and 'form' - one is an alias for the other")
         elif form and not view:
             view = form
-            
+
         if request and layer:
             raise TypeError(u"You cannot specify both 'request' and 'layer' - one is an alias for the other")
         elif layer and not request:
             request = layer
-        
-        super(widget_label, self).__init__('label', 
+
+        super(widget_label, self).__init__('label',
                 context=context,
                 request=request,
                 view=form,
@@ -106,36 +106,36 @@ def __init__(self, context=None, request=None, view=None, field=None, widget=Non
 
 class button_label(_computed_value):
     """Decorator for functions providing a computed button label::
-    
+
         @button_label()
         def get_widget(data):
             return ...
-    
+
     The 'data' object has attributes form (view), request (layer), context,
     button, and manager. These are also the possible discriminators that can
     be passed to the decorator.
     """
-    
+
     factory = ComputedButtonActionAttribute
-    
+
     def __init__(self, content=None, request=None, form=None, manager=None, button=None, view=None, layer=None, context=None):
-        
+
         if context and content:
             raise TypeError(u"You cannot specify both 'content' and 'context' - one is an alias for the other")
         elif context and not content:
             content = context
-        
+
         if form and view:
             raise TypeError(u"You cannot specify both 'view' and 'form' - one is an alias for the other")
         elif view and not form:
             form = view
-            
+
         if request and layer:
             raise TypeError(u"You cannot specify both 'request' and 'layer' - one is an alias for the other")
         elif layer and not request:
             request = layer
-        
-        super(button_label, self).__init__('title', 
+
+        super(button_label, self).__init__('title',
                 content=content,
                 request=request,
                 form=form,




-------------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CHANGES.log
Type: application/octet-stream
Size: 62785 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20140823/ac2a2c64/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: build.log
Type: application/octet-stream
Size: 119372 bytes
Desc: not available
URL: <http://lists.plone.org/pipermail/plone-testbot/attachments/20140823/ac2a2c64/attachment-0003.obj>


More information about the Testbot mailing list