+ 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)
+
+ 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)
+