Changeset 5370


Ignore:
Timestamp:
4 Aug 2010, 19:34:02 (14 years ago)
Author:
uli
Message:

Another test, this time to check applyChanges. Test coverage is now
92%.

File:
1 edited

Legend:

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

    r5369 r5370  
    422422            </tr>
    423423            ...
     424
    424425        """
    425426
     427    def test_applyChanges(self):
     428        request = TestRequest(form={'field.foo.key.0.bar': u'Hello',
     429                                    'field.foo.value.0.baz': u'world!',
     430                                    'field.foo.count': u'1'})
     431        widget = DictWidget(
     432            self.field, request)
     433        class Foo(object):
     434            foo = None
     435        foo_obj = Foo()
     436        foo_obj.foo = {u'Hello':u'world!'}
     437        assert widget.applyChanges(foo_obj) is False
     438        foo_obj.foo = {u'Goodbye':u'cruel world!'}
     439        assert widget.applyChanges(foo_obj) is True
    426440
    427441
Note: See TracChangeset for help on using the changeset viewer.