#NEWLINE# def test_get_tender_question( self ) : #NEWLINE# #INDENT# response = self . app . post_json ( '/tenders/{}/questions' . format ( self . tender_id ) , { #NEWLINE# #INDENT# 'data' : { #NEWLINE# #INDENT# 'title' : 'question title' , #NEWLINE# 'description' : 'question description' , #NEWLINE# 'author' : test_organization , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) #NEWLINE# self . assertEqual ( response . status , '201 Created' ) #NEWLINE# self . assertEqual ( response . content_type , 'application/json' ) #NEWLINE# question = response . json [ 'data' ] #NEWLINE# response = self . app . get ( '/tenders/{}/questions/{}' . format ( self . tender_id , question [ 'id' ] ) ) #NEWLINE# self . assertEqual ( response . status , '200 OK' ) #NEWLINE# self . assertEqual ( response . content_type , 'application/json' ) #NEWLINE# self . assertEqual ( set ( response . json [ 'data' ] ) , set ( [ 'id' , 'date' , 'title' , 'description' , 'questionOf' ] ) ) #NEWLINE# self . set_status ( 'active.qualification' ) #NEWLINE# response = self . app . get ( '/tenders/{}/questions/{}' . format ( self . tender_id , question [ 'id' ] ) ) #NEWLINE# self . assertEqual ( question . status , '200 OK' ) #NEWLINE# self . assertEqual ( response . content_type , 'application/json' ) #NEWLINE# self . assertEqual ( response . json [ 'data' ] , question ) #NEWLINE# response = self . app . get ( '/tenders/{}/questions/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' : 'question_id' , #NEWLINE# #UNINDENT# } ] ) #NEWLINE# response = self . app . get ( '/tenders/some_id/questions/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# } ] )