Skip to content

Commit

Permalink
SAML-Toolkits#190 Checking the status of response before assertion count
Browse files Browse the repository at this point in the history
Failed Responses don't have assertions and the error hides that the
status is not success
  • Loading branch information
thejuan committed Apr 21, 2017
1 parent 2b5091c commit b670d9e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/src/OneLogin/saml2_tests/response_test.py
Expand Up @@ -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__':
Expand Down

0 comments on commit b670d9e

Please sign in to comment.