def test_generate_response_xml(self): ''' Should generate response XML. ''' response = OutcomeResponse() response.process_xml(self.response_xml) self.assertEqual(response.generate_response_xml(), self.response_xml)
def post_outcome_request(self): """ POST an OAuth signed request to the Tool Consumer. """ session = BodyHashOAuth1Session(self.consumer_key, self.consumer_secret) body = self.generate_request_xml() headers = {'Content-Type': 'application/xml'} response = session.post(self.lis_outcome_service_url, data=body, headers=headers) outcome_response = OutcomeResponse() outcome_response.post_response = response outcome_response.response_code = response.status_code outcome_response.process_xml(response.text) self.outcome_response = outcome_response return outcome_response