Changeset 5309


Ignore:
Timestamp:
22 Jul 2010, 01:22:17 (14 years ago)
Author:
uli
Message:

Add some first WAeUPObjectDisplayWidget tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/branches/ulif-fasttables/src/waeup/sirp/widgets/tests/test_objectwidget.py

    r5308 r5309  
    1212from zope.component import provideAdapter
    1313
    14 from zope.formlib.interfaces import IInputWidget, MissingInputError
     14from zope.formlib.interfaces import (
     15    IInputWidget, IDisplayWidget,MissingInputError)
    1516from zope.formlib.widgets import TextWidget
    1617from zope.formlib.tests.test_browserwidget import BrowserWidgetTest
     
    1819
    1920from waeup.sirp.widgets.objectwidget import WAeUPObjectWidget as ObjectWidget
     21from waeup.sirp.widgets.objectwidget import (
     22    WAeUPObjectDisplayWidget as ObjectDisplayWidget)
    2023
    2124class ITestContact(Interface):
     
    102105                             in error_html)
    103106        else:
    104             self.failUnless("email: MissingInputError(u'field.foo.email', u'', None)"
    105                              in error_html)
    106             self.failUnless("name: MissingInputError(u'field.foo.name', u'', None)"
    107                              in error_html)
     107            self.failUnless(
     108                "email: MissingInputError(u'field.foo.email', u'', None)"
     109                in error_html)
     110            self.failUnless(
     111                "name: MissingInputError(u'field.foo.name', u'', None)"
     112                in error_html)
    108113
    109114    def test_applyChangesNoChange(self):
     
    123128        self.assertEqual(self.content.foo.email, u'foo@foo.test')
    124129
     130class ObjectDisplayWidgetTest(BrowserWidgetTest):
     131    """Documents and tests the display variant of object widget.
     132
     133        >>> from zope.interface.verify import verifyClass
     134        >>> verifyClass(IDisplayWidget, ObjectDisplayWidget)
     135        True
     136    """
     137
    125138
    126139def test_suite():
    127140    return unittest.TestSuite((
    128141        unittest.makeSuite(ObjectWidgetTest),
     142        unittest.makeSuite(ObjectDisplayWidgetTest),
    129143        #doctest.DocFileSuite('../objectwidget.txt',
    130144        #                     setUp=testing.setUp,
Note: See TracChangeset for help on using the changeset viewer.