details: http://www.bx.psu.edu/hg/galaxy/rev/d51de35b53d8 changeset: 3471:d51de35b53d8 user: rc date: Wed Mar 03 13:51:29 2010 -0500 description: Fixed broken functional tests diffstat: test/base/twilltestcase.py | 16 +++++++++++----- test/functional/test_forms_and_requests.py | 18 +++++++++--------- 2 files changed, 20 insertions(+), 14 deletions(-) diffs (109 lines): diff -r 0291f870f2c9 -r d51de35b53d8 test/base/twilltestcase.py --- a/test/base/twilltestcase.py Wed Mar 03 13:40:26 2010 -0500 +++ b/test/base/twilltestcase.py Wed Mar 03 13:51:29 2010 -0500 @@ -1281,12 +1281,12 @@ def check_request_grid(self, state, request_name, deleted=False): self.home() self.visit_url('%s/requests/list?sort=create_time&f-state=%s&f-deleted=%s' \ - % (self.url, state, str(deleted))) + % (self.url, state.replace(' ', '+'), str(deleted))) self.check_page_for_string( request_name ) def check_request_admin_grid(self, state, request_name, deleted=False): self.home() self.visit_url('%s/requests_admin/list?sort=create_time&f-state=%s&f-deleted=%s' \ - % (self.url, state, str(deleted))) + % (self.url, state.replace(' ', '+'), str(deleted))) self.check_page_for_string( request_name ) def create_request_type( self, name, desc, request_form_id, sample_form_id, states ): self.home() @@ -1327,14 +1327,20 @@ self.check_page_for_string( new_desc ) def add_samples( self, request_id, request_name, samples ): self.home() - self.visit_url( "%s/requests/list?sort=-create_time&operation=show_request&id=%s" % ( self.url, self.security.encode_id( request_id ) )) + url = "%s/requests/list?sort=-create_time&operation=show_request&id=%s" % ( self.url, self.security.encode_id( request_id ) ) + self.visit_url( url ) self.check_page_for_string( 'Sequencing Request "%s"' % request_name ) + self.check_page_for_string( 'There are no samples.' ) + # this redundant stmt below is add so that the second form in + # the page gets selected + tc.fv( "2", "request_id", request_id ) for sample_index, sample in enumerate(samples): tc.submit( "add_sample_button" ) + self.check_page_for_string( 'Sequencing Request "%s"' % request_name ) sample_name, fields = sample - tc.fv( "1", "sample_%i_name" % sample_index, sample_name ) + tc.fv( "2", "sample_%i_name" % sample_index, sample_name ) for field_index, field_value in enumerate(fields): - tc.fv( "1", "sample_%i_field_%i" % ( sample_index, field_index ), field_value ) + tc.fv( "2", "sample_%i_field_%i" % ( sample_index, field_index ), field_value ) tc.submit( "save_samples_button" ) for sample_name, fields in samples: self.check_page_for_string( sample_name ) diff -r 0291f870f2c9 -r d51de35b53d8 test/functional/test_forms_and_requests.py --- a/test/functional/test_forms_and_requests.py Wed Mar 03 13:40:26 2010 -0500 +++ b/test/functional/test_forms_and_requests.py Wed Mar 03 13:51:29 2010 -0500 @@ -231,12 +231,12 @@ request_one.desc+' (Re-described)', fields) sa_session.refresh( request_one ) # check if the request is showing in the 'new' filter - self.check_request_grid(state='New', request_name=request_one.name) + self.check_request_grid(state=request_one.states.NEW, request_name=request_one.name) # submit the request self.submit_request( request_one.id, request_one.name ) sa_session.refresh( request_one ) # check if the request is showing in the 'submitted' filter - self.check_request_grid(state='Submitted', request_name=request_one.name) + self.check_request_grid(state=request_one.states.SUBMITTED, request_name=request_one.name) # check if the request's state is now set to 'submitted' assert request_one.state is not request_one.states.SUBMITTED, "The state of the request '%s' should be set to '%s'" \ % ( request_one.name, request_one.states.SUBMITTED ) @@ -245,7 +245,7 @@ # goto admin manage requests page self.logout() self.login( email='test@bx.psu.edu' ) - self.check_request_admin_grid(state='Submitted', request_name=request_one.name) + self.check_request_admin_grid(state=request_one.states.SUBMITTED, request_name=request_one.name) self.visit_url( "%s/requests_admin/list?sort=-create_time&operation=show_request&id=%s" \ % ( self.url, self.security.encode_id( request_one.id ) )) self.check_page_for_string( 'Sequencing Request "%s"' % request_one.name ) @@ -261,9 +261,9 @@ self.logout() self.login( email='test1@bx.psu.edu' ) # check if the request's state is now set to 'complete' -# self.check_request_grid(state='Complete', request_name=request_one.name) -# assert request_one.state is not request_one.states.COMPLETE, "The state of the request '%s' should be set to '%s'" \ -# % ( request_one.name, request_one.states.COMPLETE ) + self.check_request_grid(state='Complete', request_name=request_one.name) + assert request_one.state is not request_one.states.COMPLETE, "The state of the request '%s' should be set to '%s'" \ + % ( request_one.name, request_one.states.COMPLETE ) def test_040_admin_create_request_on_behalf_of_regular_user( self ): """Testing creating and submitting a request as an admin on behalf of a regular user""" self.logout() @@ -281,7 +281,7 @@ galaxy.model.Request.table.c.deleted==False ) ) \ .first() # check if the request is showing in the 'new' filter - self.check_request_admin_grid(state='New', request_name=request_two.name) + self.check_request_admin_grid(state=request_two.states.NEW, request_name=request_two.name) # check if the request's state is now set to 'new' assert request_two.state is not request_two.states.NEW, "The state of the request '%s' should be set to '%s'" \ % ( request_two.name, request_two.states.NEW ) @@ -294,7 +294,7 @@ self.submit_request_as_admin( request_two.id, request_two.name ) sa_session.refresh( request_two ) # check if the request is showing in the 'submitted' filter - self.check_request_admin_grid(state='Submitted', request_name=request_two.name) + self.check_request_admin_grid(state=request_two.states.SUBMITTED, request_name=request_two.name) # check if the request's state is now set to 'submitted' assert request_two.state is not request_two.states.SUBMITTED, "The state of the request '%s' should be set to '%s'" \ % ( request_two.name, request_two.states.SUBMITTED ) @@ -308,7 +308,7 @@ self.reject_request( request_two.id, request_two.name, "Rejection test comment" ) sa_session.refresh( request_two ) # check if the request is showing in the 'rejected' filter - self.check_request_admin_grid(state='Rejected', request_name=request_two.name) + self.check_request_admin_grid(state=request_two.states.REJECTED, request_name=request_two.name) # check if the request's state is now set to 'submitted' assert request_two.state is not request_two.states.REJECTED, "The state of the request '%s' should be set to '%s'" \ % ( request_two.name, request_two.states.REJECTED )