Ignore:
Timestamp:
21 Jul 2010, 14:41:36 (14 years ago)
Author:
uli
Message:

Define test content interfaces in a different manner to make coverage
detection happy. For some strange reason while running tests normally
worked, when running tests with --coverage option the testrunner
complained about concrete attributes of now modified interfaces.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.widgets.core/trunk/src/waeup/widgets/core/tests/test_dictwidget.py

    r5293 r5294  
    5050from waeup.widgets.core.dictwidget import DictWidget, DictDisplayWidget
    5151
     52def FieldFactory(**kw):
     53    kw.update({
     54            '__name__': u'foo',
     55            'key_type': TextLine(__name__=u'bar',title=u'bar'),
     56            'value_type': TextLine(__name__=u'baz',title=u'baz')})
     57    return Dict(**kw)
     58
     59class ITestContent(Interface):
     60    foo = FieldFactory(
     61        title=u'Foo Title',
     62        description=u'',
     63        )
     64           
     65class TestObject(object):
     66    implements(ITestContent)
     67
    5268class DictWidgetTestHelper(object):
    5369
    5470    def setUpContent(self, desc=u'', title=u'Foo Title'):
    55         class ITestContent(Interface):
    56             foo = self._FieldFactory(
    57                     title=title,
    58                     description=desc,
    59                     )
    60         class TestObject(object):
    61             implements(ITestContent)
    62 
    6371        self.content = TestObject()
    6472        self.field = ITestContent['foo'].bind(self.content)
     
    7482    def tearDown(self):
    7583        traversingTearDown()
    76        
    77     def _FieldFactory(self, **kw):
    78         kw.update({
    79             '__name__': u'foo',
    80             'key_type': TextLine(__name__=u'bar',title=u'bar'),
    81             'value_type': TextLine(__name__=u'baz',title=u'baz')})
    82         return Dict(**kw)
    8384
    8485
Note: See TracChangeset for help on using the changeset viewer.