Skip to content

Commit

Permalink
Merge branch '85-after-login-url'
Browse files Browse the repository at this point in the history
  • Loading branch information
calebsyring committed Nov 5, 2019
2 parents 1d67548 + c40b10c commit 76a1222
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions keg_auth/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ def test_login_field_success(self):
resp = resp.form.submit()

assert resp.status_code == 302, resp.html
assert resp.headers['Location'] == 'http://keg.example.com/'
assert resp.headers['Location'] == flask.url_for(
flask.current_app.auth_manager.endpoints['after-login']
)
assert resp.flashes == [('success', 'Login successful.')]

def test_login_field_success_next_parameter(self):
Expand Down Expand Up @@ -110,7 +112,9 @@ def test_next_parameter_not_open_redirect(self):

assert resp.status_code == 302, resp.html
# verify the 'next' parameter was ignored
assert resp.headers['Location'] == 'http://keg.example.com/'
assert resp.headers['Location'] == flask.url_for(
flask.current_app.auth_manager.endpoints['after-login']
)
assert resp.flashes == [('success', 'Login successful.')]

# quoted next parameter
Expand All @@ -123,7 +127,9 @@ def test_next_parameter_not_open_redirect(self):

assert resp.status_code == 302, resp.html
# verify the 'next' parameter was ignored
assert resp.headers['Location'] == 'http://keg.example.com/'
assert resp.headers['Location'] == flask.url_for(
flask.current_app.auth_manager.endpoints['after-login']
)
assert resp.flashes == [('success', 'Login successful.')]

def test_login_invalid_password(self):
Expand Down

0 comments on commit 76a1222

Please sign in to comment.