Changeset 6819
- Timestamp:
- 27 Sep 2011, 08:07:54 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp/utils
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/utils/overrides.zcml
r6278 r6819 9 9 /> 10 10 11 <adapter 12 for="zope.schema.interfaces.IDate 13 zope.publisher.interfaces.browser.IBrowserRequest" 14 provides="zope.formlib.interfaces.ISimpleInputWidget" 15 factory="waeup.sirp.widgets.datewidget.FormattedDateWidget" 16 permission="zope.Public" 17 /> 18 11 19 </configure> -
main/waeup.sirp/trunk/src/waeup/sirp/utils/tests/test_converters.py
r6743 r6819 250 250 contact = Contact() 251 251 converter = IObjectConverter(IContact) # a converter to IContact 252 err, inv_err, data = converter.fromStringDict( 253 dict(birthday='1945/12/23'), contact) 252 253 # The input format for dates: YYYY-MM-DD 254 err, inv_err, data = converter.fromStringDict( 255 dict(birthday='1945-12-23'), contact) 254 256 assert data['birthday'] == datetime.date(1945, 12, 23) 255 257 assert isinstance(data['birthday'], datetime.date) 256 258 257 259 err, inv_err, data = converter.fromStringDict( 258 dict(birthday='1945/23/12'), contact) 259 assert data['birthday'] == datetime.date(1945, 12, 23) 260 261 # The preferred input format for dates: YYYY-MM-DD 262 err, inv_err, data = converter.fromStringDict( 263 dict(birthday='1945-12-23'), contact) 264 assert data['birthday'] == datetime.date(1945, 12, 23) 260 dict(birthday='1945-23-12'), contact) 261 #import pdb; pdb.set_trace() 262 #assert data['birthday'] == datetime.date(1945, 12, 23) 263 assert err[0][1] =='Invalid datetime data' 265 264 266 265 # '08' is not interpreted as octal number
Note: See TracChangeset for help on using the changeset viewer.