Skip to content

Commit

Permalink
[master][tests]: Tests more lenient - needed for Sean setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Read committed Jan 4, 2012
1 parent ec9a915 commit 50888ec
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ckan/tests/functional/test_user.py
Expand Up @@ -168,12 +168,14 @@ def test_login(self):

# first get redirected to user/logged_in
assert_equal(res.status, 302)
assert res.header('Location').startswith('http://localhost/user/logged_in')
assert res.header('Location').startswith('http://localhost/user/logged_in') or \
res.header('Location').startswith('/user/logged_in')

# then get redirected to user page
res = res.follow()
assert_equal(res.status, 302)
assert_equal(res.header('Location'), 'http://localhost/user/testlogin')
assert res.header('Location') in ('http://localhost/user/testlogin',
'/user/testlogin')
res = res.follow()
assert_equal(res.status, 200)
assert 'testlogin is now logged in' in res.body
Expand Down Expand Up @@ -215,12 +217,14 @@ def test_login_wrong_password(self):

# first get redirected to logged_in
assert_equal(res.status, 302)
assert res.header('Location').startswith('http://localhost/user/logged_in')
assert res.header('Location').startswith('http://localhost/user/logged_in') or \
res.header('Location').startswith('/user/logged_in')

# then get redirected to login
res = res.follow()
assert_equal(res.status, 302)
assert res.header('Location').startswith('http://localhost/user/login')
assert res.header('Location').startswith('http://localhost/user/login') or \
res.header('Location').startswith('/user/login')
res = res.follow()
assert_equal(res.status, 200)
assert 'Login failed. Bad username or password.' in res.body
Expand Down

0 comments on commit 50888ec

Please sign in to comment.