Esempio n. 1
0
 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)
Esempio n. 2
0
    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)
Esempio n. 3
0
    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)
Esempio n. 4
0
    def test_get_processor_defaults_to_base_processor(self):
        sp_config = {}

        assert isinstance(
            IdPHandlerViewMixin().get_processor('entity_id', sp_config),
            BaseProcessor)
Esempio n. 5
0
 def test_get_identity_provides_extra_config(self):
     obj = IdPHandlerViewMixin()