def next_reduction(): assert (make_next_param("/login", "http://localhost/profile") == "/profile") assert (make_next_param("https://localhost/login", "http://localhost/profile") == "http://localhost/profile") assert (make_next_param("http://accounts.localhost/login", "http://localhost/profile") == "http://localhost/profile")
def next_reduction(): assert (make_next_param("/login", "http://localhost/profile") == "/profile") assert (make_next_param( "https://localhost/login", "http://localhost/profile") == "http://localhost/profile") assert (make_next_param( "http://accounts.localhost/login", "http://localhost/profile") == "http://localhost/profile")
def test_make_next_param(self): self.assertEqual("/profile", make_next_param("/login", "http://localhost/profile")) self.assertEqual( "http://localhost/profile", make_next_param("https://localhost/login", "http://localhost/profile") ) self.assertEqual( "http://localhost/profile", make_next_param("http://accounts.localhost/login", "http://localhost/profile") )
def test_make_next_param(self): self.assertEqual('/profile', make_next_param('/login', 'http://localhost/profile')) self.assertEqual('http://localhost/profile', make_next_param('https://localhost/login', 'http://localhost/profile')) self.assertEqual('http://localhost/profile', make_next_param('http://accounts.localhost/login', 'http://localhost/profile'))
def unauthorized_handler(): user_unauthorized.send( user_unauthorized.send(current_app._get_current_object())) url = URLObject(login_url(login_manager.login_view, request.url)) prev_param = make_next_param(url.without_query(), request.referrer or '/') return redirect( url.add_query_param('prev', prev_param).add_query_param('mode', 'action'))
def unauthorized_handler(): user_unauthorized.send(user_unauthorized.send(current_app._get_current_object())) url = URLObject(login_url(login_manager.login_view, request.url)) prev_param = make_next_param(url.without_query(), request.referrer or "/") return redirect(url.add_query_param("prev", prev_param).add_query_param("mode", "action"))