[Checkins] SVN: z3c.wizard/trunk/s made tests compatible with z3c.form 2.0
Michael Howitz
mh at gocept.com
Thu Jul 9 14:49:14 EDT 2009
Log message for revision 101770:
made tests compatible with z3c.form 2.0
Changed:
U z3c.wizard/trunk/setup.py
U z3c.wizard/trunk/src/z3c/wizard/README.txt
-=-
Modified: z3c.wizard/trunk/setup.py
===================================================================
--- z3c.wizard/trunk/setup.py 2009-07-09 18:26:09 UTC (rev 101769)
+++ z3c.wizard/trunk/setup.py 2009-07-09 18:49:13 UTC (rev 101770)
@@ -38,7 +38,7 @@
read('CHANGES.txt')
),
license = "ZPL 2.1",
- keywords = "zope3 z3c form wizard",
+ keywords = "zope zope3 z3c form wizard",
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Web Environment',
@@ -62,11 +62,12 @@
'zope.app.testing',
'zope.publisher',
'zope.testing',
+ 'lxml',
],
),
install_requires = [
'setuptools',
- 'z3c.form',
+ 'z3c.form >= 2.0',
'z3c.formui',
'z3c.pagelet',
'zope.app.publisher',
Modified: z3c.wizard/trunk/src/z3c/wizard/README.txt
===================================================================
--- z3c.wizard/trunk/src/z3c/wizard/README.txt 2009-07-09 18:26:09 UTC (rev 101769)
+++ z3c.wizard/trunk/src/z3c/wizard/README.txt 2009-07-09 18:49:13 UTC (rev 101770)
@@ -14,11 +14,11 @@
a step is accessible depends on the conditions of each step.
Since steps are adapters, we can register steps for already existing wizards
-or we can also ovreride existing steps by register a UnavailableStep step which
+or we can also ovreride existing steps by register a UnavailableStep step which
always will return False for the ``available`` argument.
If the wizard is completed we get redirected to the confirmation page. If we
-access a completed wizard again, we will get redirected to the confirmation
+access a completed wizard again, we will get redirected to the confirmation
page again.
Now let's show how this works and setup our tests.
@@ -32,7 +32,7 @@
>>> from z3c.form.testing import setupFormDefaults
>>> setupFormDefaults()
-And load the formui confguration, which will make sure that all macros get
+And load the formui confguration, which will make sure that all macros get
registered correctly.
>>> from zope.configuration import xmlconfig
@@ -66,7 +66,7 @@
>>> from zope.schema.fieldproperty import FieldProperty
>>> class IPerson(ILocation):
... """Person interface."""
- ...
+ ...
... firstName = zope.schema.TextLine(title=u'First Name')
... lastName = zope.schema.TextLine(title=u'Last Name')
... street = zope.schema.TextLine(title=u'Street')
@@ -75,9 +75,9 @@
>>> class Person(object):
... """Person content."""
... zope.interface.implements(IPerson)
- ...
+ ...
... __name__ = __parent__ = None
- ...
+ ...
... firstName = FieldProperty(IPerson['firstName'])
... lastName = FieldProperty(IPerson['lastName'])
... street = FieldProperty(IPerson['street'])
@@ -123,19 +123,19 @@
... """Person wizard marker."""
>>> class PersonWizard(wizard.Wizard):
- ...
+ ...
... zope.interface.implements(IPersonWizard)
...
... label = u'Person Wizard'
- ...
+ ...
... def setUpSteps(self):
... return [
... step.addStep(self, 'person', weight=1),
... step.addStep(self, 'address', weight=2),
... ]
-As next, we need to register our steps as named IStep adapters. This can be
-done by the z3c:wizardStep directive. Let's define our adapters with the
+As next, we need to register our steps as named IStep adapters. This can be
+done by the z3c:wizardStep directive. Let's define our adapters with the
provideAdapter method for now:
>>> import zope.interface
@@ -159,11 +159,11 @@
>>> request = TestRequest()
>>> alsoProvides(request, IDivFormLayer)
-Now we can use our wizard. Our wizard will allways force to traverse to the
-current active step. This means the wizard provides a browserDefault which
-returns the default step instead of render the wizard as view. This allows us
-to use the step as an adapter discriminator for viewlets and other adapters
-like the menu implementation uses. The wizard acts like a dispatcher to the
+Now we can use our wizard. Our wizard will allways force to traverse to the
+current active step. This means the wizard provides a browserDefault which
+returns the default step instead of render the wizard as view. This allows us
+to use the step as an adapter discriminator for viewlets and other adapters
+like the menu implementation uses. The wizard acts like a dispatcher to the
right step and not as a view itself.
>>> personWizard = PersonWizard(person, request)
@@ -175,7 +175,7 @@
>>> obj, names = personWizard.browserDefault(request)
>>> obj
<PersonWizard u'wizard'>
-
+
>>> names
('person',)
@@ -211,10 +211,12 @@
<span class="required">*</span>
</label>
</div>
- <div class="widget"><input type="text" id="form-widgets-firstName"
- name="form.widgets.firstName"
- class="text-widget required textline-field" value="" />
- </div>
+ <div class="widget">
+ <input id="form-widgets-firstName"
+ name="form.widgets.firstName"
+ class="text-widget required textline-field"
+ value="" type="text" />
+ </div>
</div>
<div id="form-widgets-lastName-row" class="row">
<div class="label">
@@ -223,10 +225,12 @@
<span class="required">*</span>
</label>
</div>
- <div class="widget"><input type="text" id="form-widgets-lastName"
- name="form.widgets.lastName"
- class="text-widget required textline-field" value="" />
- </div>
+ <div class="widget">
+ <input id="form-widgets-lastName"
+ name="form.widgets.lastName"
+ class="text-widget required textline-field"
+ value="" type="text" />
+ </div>
</div>
</div>
<div>
@@ -234,14 +238,14 @@
<span class="back">
</span>
<span class="step">
- <input type="submit" id="form-buttons-apply"
- name="form.buttons.apply"
- class="submit-widget button-field" value="Apply" />
+ <input id="form-buttons-apply" name="form.buttons.apply"
+ class="submit-widget button-field" value="Apply"
+ type="submit" />
</span>
<span class="forward">
- <input type="submit" id="form-buttons-next"
- name="form.buttons.next"
- class="submit-widget button-field" value="Next" />
+ <input id="form-buttons-next" name="form.buttons.next"
+ class="submit-widget button-field" value="Next"
+ type="submit" />
</span>
</div>
</div>
@@ -335,10 +339,12 @@
<span class="required">*</span>
</label>
</div>
- <div class="widget"><input type="text" id="form-widgets-street"
- name="form.widgets.street"
- class="text-widget required textline-field" value="" />
- </div>
+ <div class="widget">
+ <input id="form-widgets-street"
+ name="form.widgets.street"
+ class="text-widget required textline-field"
+ value="" type="text" />
+ </div>
</div>
<div id="form-widgets-city-row" class="row">
<div class="label">
@@ -347,23 +353,24 @@
<span class="required">*</span>
</label>
</div>
- <div class="widget"><input type="text" id="form-widgets-city"
- name="form.widgets.city"
- class="text-widget required textline-field" value="" />
- </div>
+ <div class="widget">
+ <input id="form-widgets-city" name="form.widgets.city"
+ class="text-widget required textline-field"
+ value="" type="text" />
+ </div>
</div>
</div>
<div>
<div class="buttons">
<span class="back">
- <input type="submit" id="form-buttons-back"
- name="form.buttons.back"
- class="submit-widget button-field" value="Back" />
+ <input id="form-buttons-back" name="form.buttons.back"
+ class="submit-widget button-field" value="Back"
+ type="submit" />
</span>
<span class="step">
- <input type="submit" id="form-buttons-apply"
- name="form.buttons.apply"
- class="submit-widget button-field" value="Apply" />
+ <input id="form-buttons-apply" name="form.buttons.apply"
+ class="submit-widget button-field" value="Apply"
+ type="submit" />
</span>
<span class="forward">
</span>
More information about the Checkins
mailing list