Changeset 7440 for main/waeup.sirp/trunk/src/waeup/sirp
- Timestamp:
- 23 Dec 2011, 10:51:04 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/widgets/tests/test_phonewidget.py
r7435 r7440 48 48 title = u'Phone', 49 49 description = u'Phone number (not required)', 50 required = False) 50 required = False,) 51 52 baz = schema.TextLine( 53 title = u'Phone', 54 description = u'Required phone with a default', 55 required = True, 56 default=u'234--') 51 57 52 58 class SampleContent: … … 74 80 self.field_nonreq = ISampleContent['bar'] 75 81 self.field_nonreq = self.field_nonreq.bind(self.content) 82 self.field_w_default = ISampleContent['baz'] 83 self.field_w_default = self.field_w_default.bind(self.content) 76 84 77 85 # create an empty request. We need one to create a widget … … 186 194 'field.foo.country': 'not-a-number', 187 195 'field.foo.area': '456', 188 'field.foo.extension': '12345' 196 'field.foo.extension': '12345', 189 197 }) 190 198 widget = PhoneWidget(self.field, request) … … 458 466 content = Content() 459 467 request = TestRequest(form={ 460 'field.foo.country': '11', 461 'field.foo.area': '222', 462 'field.foo.extension': '3333'}) 468 'field.bar.country': '', 469 'field.bar.area': '', 470 'field.bar.extension': '', 471 }) 463 472 widget = PhoneWidget(self.field_nonreq, request) 464 473 result1 = widget.applyChanges(content) 465 474 result2 = widget.getInputValue() 466 475 self.assertEqual(result1, True) 467 # without input we get the default value set468 self.assert Equal(content.bar, u'')469 self.assert Equal(result2, u'')476 # without input we get None 477 self.assertTrue(content.bar is None) 478 self.assertTrue(result2 is None) 470 479 return 471 480
Note: See TracChangeset for help on using the changeset viewer.