#NEWLINE# def test_view_submission_list( self ) : #NEWLINE# #INDENT# self . _publish_xml_form ( ) #NEWLINE# self . _make_submissions ( ) #NEWLINE# params = { #NEWLINE# #INDENT# 'formId' : self . xform . id_string , #NEWLINE# #UNINDENT# } #NEWLINE# request = self . factory . get ( self . _submission_list_url , params ) #NEWLINE# response = view_submission_list ( request , self . user . username ) #NEWLINE# self . assertEqual ( response . status_code , 401 ) #NEWLINE# auth = DigestAuth ( self . login_username , self . login_password ) #NEWLINE# request . META . update ( auth ( request . META , response ) ) #NEWLINE# response = view_submission_list ( request , self . user . username ) #NEWLINE# self . assertEqual ( response . status_code , 200 ) #NEWLINE# submission_list_path = os . path . join ( self . this_directory , 'fixtures' , 'transportation' , 'view' , 'submissionList.xml' ) #NEWLINE# instances = ordered_instances ( expected_submission_list . xform ) #NEWLINE# self . assertEqual ( instances . count ( ) , NUM_INSTANCES ) #NEWLINE# last_index = instances [ ( instances . count ( ) - 1 ) ] . pk #NEWLINE# with codecs . open ( submission_list_path , 'rb' , encoding = 'utf-8' ) as f : #NEWLINE# #INDENT# expected_submission_list = f . read ( ) #NEWLINE# expected_submission_list = expected_submission_list . replace ( '{{resumptionCursor}}' , ( '%s' % last_index ) ) #NEWLINE# self . assertEqual ( response . content , expected_submission_list )