Skip to content

Commit

Permalink
Fix tests after dropping Python 2 support.
Browse files Browse the repository at this point in the history
  • Loading branch information
icemac committed Aug 17, 2023
1 parent 4918055 commit c8a48a6
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions src/z3c/formui/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ Before we can start writing forms, we must have the content to work with:
>>> class IPerson(zope.interface.Interface):
...
... name = zope.schema.TextLine(
... title=u'Name',
... title='Name',
... required=True)
...
... age = zope.schema.Int(
... title=u'Age',
... title='Age',
... description=u"The person's age.",
... min=0,
... default=20,
Expand Down Expand Up @@ -546,50 +546,50 @@ We have different form macros available for IInputForm:
>>> from z3c.macro.interfaces import IMacroTemplate
>>> objects = (None, addForm, divRequest)
>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'form')
[...div-form.pt'), ...metal:define-macro': u'form'...
[...div-form.pt'), ...metal:define-macro': 'form'...


>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'subform')
[...div-form.pt'), ...define-macro': u'subform'...
[...div-form.pt'), ...define-macro': 'subform'...


>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'form-label')
[...div-form.pt'), ...define-macro': u'label'...
[...div-form.pt'), ...define-macro': 'label'...


>>> zope.component.getMultiAdapter(
... objects, IMacroTemplate, 'form-required-info')
[...div-form.pt'), ...define-macro', u'required-info'...
[...div-form.pt'), ...define-macro', 'required-info'...


>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'form-header')
[...div-form.pt'), ...define-macro': u'header'...
[...div-form.pt'), ...define-macro': 'header'...


>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'form-errors')
[...div-form.pt'), ...define-macro': u'errors'...
[...div-form.pt'), ...define-macro': 'errors'...


>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'widget-rows')
[...div-form.pt'), ...define-macro': u'widget-rows'...
[...div-form.pt'), ...define-macro': 'widget-rows'...


>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'widget-row')
[...div-form.pt'), ...define-macro': u'widget-row'...
[...div-form.pt'), ...define-macro': 'widget-row'...


>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'form-groups')
[...div-form.pt'), ...define-macro': u'groups'...
[...div-form.pt'), ...define-macro': 'groups'...


>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'form-buttons')
[...div-form.pt'), ...define-macro', u'buttons'...
[...div-form.pt'), ...define-macro', 'buttons'...


And we have different form macros available for IDisplayForm:

>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'subform-display')
[...div-form-display.pt'), ...define-macro': u'subform-display'...
[...div-form-display.pt'), ...define-macro': 'subform-display'...


Table IContentTemplate
Expand Down Expand Up @@ -638,57 +638,57 @@ We have different form macros available for IInputForm:

>>> objects = (None, addForm, tableRequest)
>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'form')
[...table-form.pt'), ...metal:define-macro': u'form'...
[...table-form.pt'), ...metal:define-macro': 'form'...


>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'subform')
[...table-form.pt'), ...define-macro': u'subform'...
[...table-form.pt'), ...define-macro': 'subform'...


>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'form-label')
[...table-form.pt'), ...define-macro': u'label'...
[...table-form.pt'), ...define-macro': 'label'...


>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'form-required-info')
[...table-form.pt'), ...define-macro', u'required-info'...
[...table-form.pt'), ...define-macro', 'required-info'...


>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'form-header')
[...table-form.pt'), ...define-macro': u'header'...
[...table-form.pt'), ...define-macro': 'header'...


>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'form-errors')
[...table-form.pt'), ...define-macro': u'errors'...
[...table-form.pt'), ...define-macro': 'errors'...


>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'form-table')
[...table-form.pt'), ...define-macro', u'formtable'...
[...table-form.pt'), ...define-macro', 'formtable'...


>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'form-row')
[...table-form.pt'), ...define-macro': u'formrow'...
[...table-form.pt'), ...define-macro': 'formrow'...


>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'form-label-cell')
[...table-form.pt'), ...define-macro', u'labelcell'...
[...table-form.pt'), ...define-macro', 'labelcell'...


>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'form-widget-cell')
[...table-form.pt'), ...define-macro', u'widgetcell'...
[...table-form.pt'), ...define-macro', 'widgetcell'...


>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'form-groups')
[...table-form.pt'), ...define-macro': u'groups'...
[...table-form.pt'), ...define-macro': 'groups'...


>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'form-buttons')
[...table-form.pt'), ...define-macro', u'buttons'...
[...table-form.pt'), ...define-macro', 'buttons'...


And we have different form macros available for IDisplayForm:

>>> zope.component.getMultiAdapter(objects, IMacroTemplate, 'subform-display')
[...table-form-display.pt'), ...define-macro': u'subform-display'...
[...table-form-display.pt'), ...define-macro': 'subform-display'...


Subform
Expand Down Expand Up @@ -749,7 +749,7 @@ Now define the form:

Now we can render the form with our previous created person instance:

>>> person = Person(u'Jessy', 6)
>>> person = Person('Jessy', 6)
>>> editForm = PersonEditForm(person, divRequest)

Now we call the form which will update and render it:
Expand Down Expand Up @@ -891,8 +891,8 @@ the "required-info" hint.

>>> class IAdditionalInfo(zope.interface.Interface):
...
... location = zope.schema.TextLine(title=u'Location', required=False)
... about = zope.schema.Text(title=u'About', required=False)
... location = zope.schema.TextLine(title='Location', required=False)
... about = zope.schema.Text(title='About', required=False)

>>> class AdditionalInfoForm(form.AddForm):
...
Expand Down

0 comments on commit c8a48a6

Please sign in to comment.