Show
Ignore:
Timestamp:
03/10/10 12:32:00 (6 months ago)
Author:
acracia
Branch:
default
Message:

[api]to_dict method on the model, tailored to use as input of the api

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pdw/tests/test_model.py

    r325 r326  
    5858        out = work.to_dict() 
    5959        assert out['title'] == work.title 
    60         assert out['persons'] == work.persons 
     60        assert len(out['persons']) == len(work.persons) 
    6161        assert out['date'] == '1704', out 
    6262        # test it serializes ok 
     
    8181            'title': newtitle, 
    8282            'date': u'1881', 
     83            'type': u'text', 
    8384            'persons': [ 
    8485                { 'name': name1, 'death_date': u'1887' },