def test_login_url_helper(): client = cas.CASClientBase(renew=False, extra_login_params=False, server_url='http://www.example.com/cas/', service_url='http://testserver/') actual = client.get_login_url() expected = 'http://www.example.com/cas/login?service=http%3A%2F%2Ftestserver%2F' assert actual == expected
def test_login_url_helper_with_renew(): client = cas.CASClientBase(renew=True, extra_login_params=None, server_url='http://www.example.com/cas/', service_url='http://testserver/') actual = client.get_login_url() # since the dictionary of parameters is unordered, we dont know which # parameter will be first, so just check that both are in the url. assert 'service=http%3A%2F%2Ftestserver%2F' in actual assert 'renew=true' in actual