def test_create_html_response_with_get(self): mixin = IdPHandlerViewMixin() try: mixin.dispatch(HttpRequest()) except AttributeError: html_response = mixin.create_html_response( HttpRequest(), BINDING_HTTP_REDIRECT, "SAMLResponse", "https://sp.example.com/SAML2", "") assert isinstance(html_response['data'], str)
def test_build_authn_response(self): mixin = IdPHandlerViewMixin() try: mixin.dispatch(HttpRequest()) except AttributeError: mixin.set_sp('test_generic_sp') mixin.set_processor() user = User() authn = mixin.get_authn() resp_args = { "in_response_to": "SP_Initiated_Login", "destination": "https://sp.example.com/SAML2", } assert isinstance( mixin.build_authn_response(user, authn, resp_args), Response)
def test_dispatch_correctly_assigns_a_conf_object(self): mixin = IdPHandlerViewMixin() try: mixin.dispatch(HttpRequest()) except AttributeError: assert isinstance(mixin.IDP, Server)