Skip to content

Instantly share code, notes, and snippets.

@davidread
Created January 4, 2012 11:50
Show Gist options
  • Save davidread/1559717 to your computer and use it in GitHub Desktop.
Save davidread/1559717 to your computer and use it in GitHub Desktop.
diff --git a/ckan/tests/functional/test_user.py b/ckan/tests/functional/test_user.py
index 4ae63c0..3afc1f2 100644
--- a/ckan/tests/functional/test_user.py
+++ b/ckan/tests/functional/test_user.py
@@ -168,12 +168,14 @@ class TestUserController(FunctionalTestCase, HtmlCheckMethods, PylonsTestCase, S
# 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
@@ -215,12 +217,14 @@ class TestUserController(FunctionalTestCase, HtmlCheckMethods, PylonsTestCase, S
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment