예제 #1
0
    def test_cas2_validate_twice(self):
        response = self._login_user('root', '123')
        response2 = self._validate_cas2(response, True)
        user = User.objects.get(username=self.username)
        self.assertEqual(response2.content, _cas2_sucess_response(user).content)

        response2 = self._validate_cas2(response, True)
        self.assertEqual(response2.content, _cas2_error_response(INVALID_TICKET).content)
예제 #2
0
    def test_cas2_validate_twice_with_pgt(self):
        proxyTarget = "http://my.sweet.service_1"
        response = self._login_user('root', '123')
        response2 = self._validate_cas2(response, True, proxyTarget)
        user = User.objects.get(username=self.username)
        self.assertEqual(response2.content, _cas2_sucess_response(user).content)

        response2 = self._validate_cas2(response, True, proxyTarget)
        self.assertEqual(response2.content, _cas2_error_response(INVALID_TICKET).content)
예제 #3
0
 def test_cas2_success_validate(self):
     response = self._login_user('root', '123')
     response = self._validate_cas2(response, True)
     user = User.objects.get(username=self.username)
     self.assertEqual(response.content, _cas2_sucess_response(user).content)
예제 #4
0
 def test_cas2_success_validate(self):
     response = self._login_user('root', '123')
     response = self._validate_cas2(response, True)
     user = User.objects.get(username=self.username)
     self.assertEqual(response.content, _cas2_sucess_response(user).content)