#NEWLINE# def test_forms_endpoint_with_metadata( self ) : #NEWLINE# #INDENT# for data_type in [ 'supporting_doc' , 'media' , 'source' ] : #NEWLINE# #INDENT# self . _add_form_metadata ( self . xform , data_type , self . data_value , self . path ) #NEWLINE# #UNINDENT# view = XFormViewSet . as_view ( { #NEWLINE# #INDENT# 'get' : 'retrieve' , #NEWLINE# #UNINDENT# } ) #NEWLINE# formid = self . xform . pk #NEWLINE# request = self . factory . get ( '/' , ** self . extra ) #NEWLINE# response = view ( request , pk = formid ) #NEWLINE# self . assertEqual ( response . status_code , 200 ) #NEWLINE# data = XFormSerializer ( self . xform , context = { #NEWLINE# #INDENT# 'request' : request , #NEWLINE# #UNINDENT# } ) . data #NEWLINE# self . assertEqual ( response . data , data ) #NEWLINE# view = ProjectViewSet . as_view ( { #NEWLINE# #INDENT# 'get' : 'forms' , #NEWLINE# #UNINDENT# } ) #NEWLINE# request = self . factory . get ( '/' , ** self . extra ) #NEWLINE# response = view ( request , pk = self . project . pk ) #NEWLINE# self . assertEqual ( response . status_code , 200 ) #NEWLINE# self . assertEqual ( response . data , [ data ] )