From 3ee7e0ae98cf1ac05054d9ba21b06b8f72439ce1 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Sun, 16 Oct 2022 19:42:31 +0200 Subject: [PATCH] Add a unit test with a non ascii char in service url as reported in #82 --- cas_server/tests/test_view.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cas_server/tests/test_view.py b/cas_server/tests/test_view.py index a1aba1b..e216b97 100644 --- a/cas_server/tests/test_view.py +++ b/cas_server/tests/test_view.py @@ -337,6 +337,16 @@ class LoginTestCase(TestCase, BaseServicePattern, CanLogin): self.assertFalse(b"Service https://www.example.net not allowed" in response.content) def test_view_login_get_auth_allowed_service(self): + """Request a ticket for an allowed service by an authenticated client containing non ascii char in url""" + # get a client that is already authenticated + client = get_auth_client() + # ask for a ticket for https://www.example.com + response = client.get("/login?service=https://www.example.com/é") + # as https://www.example.com/é is a valid service a ticket should be created and the + # user redirected to the service url + self.assert_service_ticket(client, response) + + def test_view_login_get_auth_allowed_service_non_ascii(self): """Request a ticket for an allowed service by an authenticated client""" # get a client that is already authenticated client = get_auth_client()