From c2f27074470ac8a444bc68f6866f90fb43562abd Mon Sep 17 00:00:00 2001 From: tobes Date: Wed, 19 Jun 2013 18:49:16 +0100 Subject: [PATCH] [#1025] Fix failing tests due to extra redirect etc (stupid tests) --- ckan/tests/functional/test_user.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ckan/tests/functional/test_user.py b/ckan/tests/functional/test_user.py index 3c02e27b1a7..70091fcd8af 100644 --- a/ckan/tests/functional/test_user.py +++ b/ckan/tests/functional/test_user.py @@ -99,9 +99,10 @@ def test_user_login_page(self): assert 'Don\'t have an OpenID' in res, res def test_logout(self): - res = self.app.get('/user/logout') + res = self.app.get('/user/_logout') res2 = res.follow() - res2 = res2.follow() + while res2.status == 302: + res2 = res2.follow() assert 'You have logged out successfully.' in res2, res2 def _get_cookie_headers(self, res): @@ -142,6 +143,7 @@ def test_login(self): # then get redirected to user's dashboard res = res.follow() + res = res.follow() assert_equal(res.status, 302) assert res.header('Location').startswith('http://localhost/dashboard') or \ res.header('Location').startswith('/dashboard') @@ -214,6 +216,7 @@ def test_login_wrong_password(self): # then get redirected to login res = res.follow() + res = res.follow() assert_equal(res.status, 302) assert res.header('Location').startswith('http://localhost/user/login') or \ res.header('Location').startswith('/user/login') @@ -336,9 +339,10 @@ def test_register_whilst_logged_in(self): assert 'logout' in res.body, res.body # logout and login as user B - res = self.app.get('/user/logout') + res = self.app.get('/user/_logout') res2 = res.follow() - res2 = res2.follow() + while res2.status == 302: + res2 = res2.follow() assert 'You have logged out successfully.' in res2, res2 offset = url_for(controller='user', action='login') res = self.app.get(offset)