Skip to content

Commit b670d9e

Browse files
committed
#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
1 parent 2b5091c commit b670d9e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/src/OneLogin/saml2_tests/response_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,10 +1396,10 @@ def testStatusCheckBeforeAssertionCheck(self):
13961396
Tests the status of a response is checked before the assertion count. As failed statuses will have no assertions
13971397
"""
13981398
settings = OneLogin_Saml2_Settings(self.loadSettingsJSON())
1399-
xml_2 = self.file_contents(join(self.data_path, 'responses', 'invalids', 'status_code_responder.xml.base64'))
1400-
response_2 = OneLogin_Saml2_Response(settings, xml_2)
1399+
xml = self.file_contents(join(self.data_path, 'responses', 'invalids', 'status_code_responder.xml.base64'))
1400+
response = OneLogin_Saml2_Response(settings, xml)
14011401
with self.assertRaisesRegexp(OneLogin_Saml2_ValidationError, 'The status code of the Response was not Success, was Responder'):
1402-
response_2.is_valid(self.get_request_data(), raise_exceptions=True)
1402+
response.is_valid(self.get_request_data(), raise_exceptions=True)
14031403

14041404

14051405
if __name__ == '__main__':

0 commit comments

Comments
 (0)