Commit 9bae3711 authored by Valentin Samir's avatar Valentin Samir

Add serviceValidate ProxyTicket tests

parent 5f5f3595
......@@ -1112,7 +1112,9 @@ class ValidateServiceTestCase(TestCase, XmlContent):
name="localhost",
pattern="^https?://127\.0\.0\.1(:[0-9]+)?(/.*)?$",
# allow to request PGT by the service
proxy_callback=True
proxy_callback=True,
# allow to request PT for the service
proxy=True
)
# tell the service pattern to transmit all the user attributes (* is a joker)
models.ReplaceAttributName.objects.create(name="*", service_pattern=self.service_pattern)
......@@ -1190,6 +1192,25 @@ class ValidateServiceTestCase(TestCase, XmlContent):
# the attributes settings.CAS_TEST_ATTRIBUTES
self.assert_success(response, settings.CAS_TEST_USER, settings.CAS_TEST_ATTRIBUTES)
def test_validate_proxy(self):
ticket = get_proxy_ticket(self.service)
client = Client()
# requesting validation with a good (ticket, service)
response = client.get('/proxyValidate', {'ticket': ticket.value, 'service': self.service})
# and it should succeed
self.assert_success(response, settings.CAS_TEST_USER, settings.CAS_TEST_ATTRIBUTES)
ticket = get_proxy_ticket(self.service)
client = Client()
# requesting validation with a good (ticket, service)
response = client.get('/serviceValidate', {'ticket': ticket.value, 'service': self.service})
# and it should succeed
self.assert_error(
response,
"INVALID_TICKET",
ticket.value
)
def test_validate_service_renew(self):
"""test with a valid (ticket, service) asking for auth renewal"""
# case 1 client is renewing and service ask for renew
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment