Index: main/waeup.cas/trunk/waeup/cas/tests/test_server.py
===================================================================
--- main/waeup.cas/trunk/waeup/cas/tests/test_server.py	(revision 10490)
+++ main/waeup.cas/trunk/waeup/cas/tests/test_server.py	(revision 10491)
@@ -13,5 +13,5 @@
     create_tgc_value, check_login_ticket, set_session_cookie,
     check_session_cookie, get_template, delete_session_cookie,
-    check_service_ticket,
+    check_service_ticket, update_url
     )
 
@@ -564,2 +564,14 @@
         assert check_service_ticket(
             db,  'ST-123456', 'http://myservice.com', False) is not None
+
+    def test_update_url(self):
+        # we can create valid new urls with query string params updated
+        url = 'http://sample.com/index?a=1&b=2'
+        result1 = update_url('http://sample.com/index?a=1&b=2', dict(b='3'))
+        assert result1 == 'http://sample.com/index?a=1&b=3'
+        result2 = update_url('http://sample.com/index?b=2', dict(b='3'))
+        assert result2 == 'http://sample.com/index?b=3'
+        result3 = update_url('http://sample.com/index', dict(b='3'))
+        assert result3 == 'http://sample.com/index?b=3'
+        result4 = update_url('http://sample.com/index?a=2', dict(b='3'))
+        assert result4 == 'http://sample.com/index?a=2&b=3'
