#NEWLINE# def test_patch_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 . patch_json ( '/tenders/{}/contracts/{}' . format ( self . tender_id , contract [ 'id' ] ) , { #NEWLINE# #INDENT# 'data' : { #NEWLINE# #INDENT# 'status' : 'active' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , status = 403 ) #NEWLINE# self . assertEqual ( response . status , '403 Forbidden' ) #NEWLINE# self . assertEqual ( response . content_type , 'application/json' ) #NEWLINE# self . assertIn ( "Can't sign contract before stand-still period end (" , response . json [ 'errors' ] [ 0 ] [ 'description' ] ) #NEWLINE# self . set_status ( 'complete' , { #NEWLINE# #INDENT# 'status' : 'active.awarded' , #NEWLINE# #UNINDENT# } ) #NEWLINE# response = self . app . post_json ( '/tenders/{}/cancellations' . format ( contract . tender_id ) , { #NEWLINE# #INDENT# 'data' : { #NEWLINE# #INDENT# 'reason' : 'cancellation reason' , #NEWLINE# 'status' : 'active' , #NEWLINE# 'cancellationOf' : 'lot' , #NEWLINE# 'relatedLot' : self . initial_lots [ 0 ] [ 'id' ] , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# response = self . app . patch_json ( '/tenders/{}/contracts/{}' . format ( self . tender_id , contract [ 'id' ] ) , { #NEWLINE# #INDENT# 'data' : { #NEWLINE# #INDENT# 'status' : 'active' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } , status = 403 ) #NEWLINE# self . assertEqual ( response . status , '403 Forbidden' ) #NEWLINE# self . assertEqual ( response . content_type , 'application/json' ) #NEWLINE# self . assertEqual ( response . json [ 'errors' ] [ 0 ] [ 'description' ] , 'Can update contract only in active lot status' )