示例#1
0
    def test_get_authn_returns_correctly_when_no_req_info(self):
        mixin = IdPHandlerViewMixin()

        assert mixin.get_authn() == {
            'authn_auth': '',
            'class_ref': 'urn:oasis:names:tc:SAML:2.0:ac:classes:Password',
            'level': 0,
            'method': ''
        }
示例#2
0
 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)