From b670d9e091fc85b8b9da7d590fe8a4574c7e55a8 Mon Sep 17 00:00:00 2001 From: adam Date: Fri, 21 Apr 2017 18:11:07 +1000 Subject: [PATCH] #190 Checking the status of response before assertion count Failed Responses don't have assertions and the error hides that the status is not success --- tests/src/OneLogin/saml2_tests/response_test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/src/OneLogin/saml2_tests/response_test.py b/tests/src/OneLogin/saml2_tests/response_test.py index cea605d1..7e040ec5 100644 --- a/tests/src/OneLogin/saml2_tests/response_test.py +++ b/tests/src/OneLogin/saml2_tests/response_test.py @@ -1396,10 +1396,10 @@ def testStatusCheckBeforeAssertionCheck(self): Tests the status of a response is checked before the assertion count. As failed statuses will have no assertions """ settings = OneLogin_Saml2_Settings(self.loadSettingsJSON()) - xml_2 = self.file_contents(join(self.data_path, 'responses', 'invalids', 'status_code_responder.xml.base64')) - response_2 = OneLogin_Saml2_Response(settings, xml_2) + xml = self.file_contents(join(self.data_path, 'responses', 'invalids', 'status_code_responder.xml.base64')) + response = OneLogin_Saml2_Response(settings, xml) with self.assertRaisesRegexp(OneLogin_Saml2_ValidationError, 'The status code of the Response was not Success, was Responder'): - response_2.is_valid(self.get_request_data(), raise_exceptions=True) + response.is_valid(self.get_request_data(), raise_exceptions=True) if __name__ == '__main__':