#NEWLINE# def test_get_tender_contract( self ) : #NEWLINE# #INDENT# response = self . app . post_json ( '/tenders/{}/contracts' . format ( self . tender_id ) , { #NEWLINE# #INDENT# 'data' : { #NEWLINE# #INDENT# 'title' : 'contract title' , #NEWLINE# 'description' : 'contract description' , #NEWLINE# 'awardID' : self . award_id , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( response . status , '201 Created' ) #NEWLINE# self . assertEqual ( response . content_type , 'application/json' ) #NEWLINE# contract = response . json [ 'data' ] #NEWLINE# response = self . app . get ( '/tenders/{}/contracts/{}' . format ( self . tender_id , contract [ 'id' ] ) ) #NEWLINE# self . assertEqual ( response . status , '200 OK' ) #NEWLINE# self . assertEqual ( response . content_type , 'application/json' ) #NEWLINE# self . assertEqual ( response . json [ 'data' ] , contract ) #NEWLINE# response = self . app . get ( '/tenders/{}/contracts/some_id' . format ( self . tender_id ) , status = 404 ) #NEWLINE# self . assertEqual ( response . status , '404 Not Found' ) #NEWLINE# self . assertEqual ( response . content_type , 'application/json' ) #NEWLINE# self . assertEqual ( response . json [ 'status' ] , 'error' ) #NEWLINE# self . assertEqual ( response . json [ 'errors' ] , [ { #NEWLINE# #INDENT# 'description' : 'Not Found' , #NEWLINE# 'location' : 'url' , #NEWLINE# 'name' : 'contract_id' , #NEWLINE# #UNINDENT# } ] ) #NEWLINE# response = self . app . get ( '/tenders/some_id/contracts/some_id' , status = 404 ) #NEWLINE# self . assertEqual ( response . status , '404 Not Found' ) #NEWLINE# self . assertEqual ( response . content_type , 'application/json' ) #NEWLINE# self . assertEqual ( response . json [ 'status' ] , 'error' ) #NEWLINE# self . assertEqual ( response . json [ 'errors' ] , [ { #NEWLINE# #INDENT# 'description' : 'Not Found' , #NEWLINE# 'location' : 'url' , #NEWLINE# 'name' : 'tender_id' , #NEWLINE# #UNINDENT# } ] )