[Zope3-checkins] CVS: Zope3/src/zope/app/browser/form/ftests -
test_registrations.py:1.1.2.1
Garrett Smith
garrett at mojave-corp.com
Sun Feb 8 20:16:03 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/browser/form/ftests
In directory cvs.zope.org:/tmp/cvs-serv6571/src/zope/app/browser/form/ftests
Added Files:
Tag: ozzope-widgets-branch
test_registrations.py
Log Message:
Added stub for testing of widget registrations.
=== Added File Zope3/src/zope/app/browser/form/ftests/test_registrations.py ===
import unittest, doctest
from zope.app import zapi
import zope.schema as fields
from zope.publisher.browser import TestRequest
import zope.app.browser.form.widget as widgets
from zope.app.interfaces.form import IEditWidget
from zope.app.interfaces.form import IDisplayWidget
request = TestRequest()
class Tests:
"""
The following illustrates the typical widget registrations for field types:
TextWidget -> ITextLine
>>> text = fields.TextLine()
>>> widget = zapi.getViewProviding(text, IEditWidget, request)
>>> isinstance(widget, widgets.TextWidget)
True
"""
def test_suite():
return doctest.DocTestSuite()
if __name__=='__main__':
unittest.main(defaultTest='test_suite')
More information about the Zope3-Checkins
mailing list