def test_create_html_response_with_get(self): mixin = IdPHandlerViewMixin() html_response = mixin.create_html_response( HttpRequest(), BINDING_HTTP_REDIRECT, "SAMLResponse", "https://sp.example.com/SAML2", "") assert isinstance(html_response['data'], str)
def test_get_processor_loads_custom_processor(self): sp_config = {'processor': 'tests.test_views.CustomProcessor'} assert isinstance( IdPHandlerViewMixin().get_processor('entity_id', sp_config), CustomProcessor)
def test_get_processor_errors_if_processor_cannot_be_loaded(self): sp_config = {'processor': 'this.does.not.exist'} with pytest.raises(Exception): IdPHandlerViewMixin().get_processor('entity_id', sp_config)
def test_get_processor_defaults_to_base_processor(self): sp_config = {} assert isinstance( IdPHandlerViewMixin().get_processor('entity_id', sp_config), BaseProcessor)
def test_get_identity_provides_extra_config(self): obj = IdPHandlerViewMixin()