def test_is_request_using_sso_false_with_session():
    """
    Testing the usual case for non-sso requests.
    """
    request = RequestFactory().get('/sso/test')
    generator.create_request_session(request)
    eq(is_request_using_sso(request), False)
def test_is_request_using_sso_true():
    """
    Testing the successful criteria for an sso request.
    """
    request = RequestFactory().get('/sso/test')
    generator.create_request_session(request, use_sso=True)
    eq(is_request_using_sso(request), True)
Example #3
0
 def setUp(self):
     super().setUp()
     self.request = RequestFactory().get('/sso/test')
     generator.create_request_session(self.request, use_sso=True)
     MessageMiddleware().process_request(
         self.request)  # add support for messages
     self.request.user = self.user
Example #4
0
 def test_two_factor_check_with_sso_request(self):
     view_func = 'dummy_view_func'
     request = self.request
     create_request_session(request, use_sso=True)
     two_factor_required_bool = _two_factor_required(
         view_func, self.domain, request)
     self.assertFalse(two_factor_required_bool)
Example #5
0
 def setUp(self):
     super().setUp()
     self.request = RequestFactory().get('/sso/test')
     create_request_session(self.request)