Ignore:
Timestamp:
4 Jun 2011, 12:35:13 (13 years ago)
Author:
uli
Message:

Check whether the preferred date format ('YYYY-MM-DD') is accepted by
converters.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.sirp/trunk/src/waeup/sirp/utils/tests/test_converters.py

    r6278 r6279  
    262262        assert data['birthday'] == datetime.date(1945, 12, 23)
    263263
    264         #err, inv_err, data = converter.fromStringDict(
    265         #    dict(birthday='23/12/1945'), contact)
    266         #assert data['birthday'] == datetime.date(1945, 12, 23)
    267 
    268         #err, inv_err, data = converter.fromStringDict(
    269         #    dict(birthday='23.12.1945'), contact)
    270         #assert data['birthday'] == datetime.date(1945, 12, 23)
    271 
    272         #err, inv_err, data = converter.fromStringDict(
    273         #    dict(birthday='23-12-1945'), contact)
    274         #assert data['birthday'] == datetime.date(1945, 12, 23)
     264        # The preferred input format for dates: YYYY-MM-DD
     265        err, inv_err, data = converter.fromStringDict(
     266            dict(birthday='1945-12-23'), contact)
     267        assert data['birthday'] == datetime.date(1945, 12, 23)
     268
     269        # '08' is not interpreted as octal number
     270        err, inv_err, data = converter.fromStringDict(
     271            dict(birthday='1945-12-08'), contact)
     272        assert data['birthday'] == datetime.date(1945, 12, 8)
    275273        return
    276274
Note: See TracChangeset for help on using the changeset viewer.