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_pd.py

    r325 r326  
    418418        calc = pd.determine_status(newwork,'ca') 
    419419        return calc 
     420        assert 'confidence' in calc.log 
    420421 
    421422    def test_uk(self): 
    422423        ''' 
    423         simple parsing of the json to create objects and pass them to the  
    424         calculators / currently uk calculator is working. not Canadian one 
     424        test the calculator api for the UK 
    425425        ''' 
    426426        parsed = json.loads(self.json_data2) 
     
    428428        jurisdiction = parsed['jurisdiction'] 
    429429        newwork = model.Work.from_dict(workdata) 
     430        model.Session.remove() 
    430431        calc = pd.determine_status(newwork,jurisdiction) 
    431432 
    432433        print parsed   
    433434        return calc 
     435        assert calc.log>0 
    434436 
    435437    def test_ca(self): 
    436438        ''' 
    437         simple parsing of the json to create objects and pass them to the  
    438         calculators / currently uk calculator is working. not Canadian one 
     439        test the calculator api for Canada 
    439440 
    440441        ''' 
     
    443444        jurisdiction = parsed['jurisdiction'] 
    444445        newwork = model.Work.from_dict(workdata) 
     446        model.Session.remove() 
    445447        calc = pd.determine_status(newwork,jurisdiction) 
    446448