def test_response_with_multiple_status_fields(self): response = self.create_response_object( 200, self.response_xml, major_code='<imsx_codeMajor>success</imsx_codeMajor>' '<imsx_codeMajor>failure</imsx_codeMajor>' ) self.assertFalse(outcomes.check_replace_result_response(response))
def test_response_with_multiple_status_fields(self): response = self.create_response_object( 200, self.response_xml, major_code='<imsx_codeMajor>success</imsx_codeMajor>' '<imsx_codeMajor>failure</imsx_codeMajor>') self.assertFalse(outcomes.check_replace_result_response(response))
def test_response_with_no_status_field(self): response = self.create_response_object(200, self.response_xml, major_code='') self.assertFalse(outcomes.check_replace_result_response(response))
def test_response_with_invalid_xml(self): xml = '<badly>formatted</xml>' response = self.create_response_object(200, xml) self.assertFalse(outcomes.check_replace_result_response(response))
def test_response_with_bad_status_code(self): response = self.create_response_object(500, '') self.assertFalse(outcomes.check_replace_result_response(response))
def test_response_with_correct_xml(self): xml = self.response_xml response = self.create_response_object(200, xml) self.assertTrue(outcomes.check_replace_result_response(response))
def test_response_with_no_status_field(self): response = self.create_response_object( 200, self.response_xml, major_code='' ) self.assertFalse(outcomes.check_replace_result_response(response))
def test_response_with_invalid_xml(self): xml = '<badly>formatted</xml>' response = self.create_response_object(200, xml) self.assertFalse(outcomes.check_replace_result_response(response))
def test_response_with_bad_status_code(self): response = self.create_response_object(500, '') self.assertFalse(outcomes.check_replace_result_response(response))
def test_response_with_correct_xml(self): xml = self.response_xml response = self.create_response_object(200, xml) self.assertTrue(outcomes.check_replace_result_response(response))