mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-14 21:43:01 +00:00
token expiry fixes
typos in token expiry: - omitted from token model (it's in the spec in docs, but wasn't in the model) - wrong type when sorting oauth tokens on token page could cause token page to not render
This commit is contained in:
@@ -598,6 +598,29 @@ def test_announcements(app, announcements):
|
||||
assert_announcement("logout", r.text)
|
||||
|
||||
|
||||
@pytest.mark.gen_test
|
||||
def test_token_page(app):
|
||||
name = "cake"
|
||||
cookies = yield app.login_user(name)
|
||||
r = yield get_page("token", app, cookies=cookies)
|
||||
r.raise_for_status()
|
||||
assert urlparse(r.url).path.endswith('/hub/token')
|
||||
assert "Request new API token" in r.text
|
||||
assert "API Tokens" in r.text
|
||||
assert "Server at %s" % app.users[name].url in r.text
|
||||
# no oauth tokens yet, shouldn't have that section
|
||||
assert "Authorized Applications" not in r.text
|
||||
|
||||
# spawn the user to trigger oauth, etc.
|
||||
r = yield get_page("spawn", app, cookies=cookies)
|
||||
r.raise_fo_status()
|
||||
|
||||
r = yield get_page("token", app, cookies=cookies)
|
||||
r.raise_for_status()
|
||||
assert "API Tokens" in r.text
|
||||
assert "Authorized Applications" not in r.text
|
||||
|
||||
|
||||
@pytest.mark.gen_test
|
||||
def test_server_not_running_api_request(app):
|
||||
cookies = yield app.login_user("bees")
|
||||
|
Reference in New Issue
Block a user