mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-18 15:33:02 +00:00
ensure prefix is on next_url in test_pages
This commit is contained in:
@@ -216,11 +216,12 @@ def test_spawn_form(app):
|
|||||||
orm_u = orm.User.find(app.db, 'jones')
|
orm_u = orm.User.find(app.db, 'jones')
|
||||||
u = app.users[orm_u]
|
u = app.users[orm_u]
|
||||||
yield u.stop()
|
yield u.stop()
|
||||||
|
next_url = ujoin(app.base_url, 'user/jones/tree')
|
||||||
r = yield async_requests.post(ujoin(base_url, 'spawn?next=/user/jones/tree'), cookies=cookies, data={
|
r = yield async_requests.post(
|
||||||
'bounds': ['-1', '1'],
|
url_concat(ujoin(base_url, 'spawn'), {'next': next_url}),
|
||||||
'energy': '511keV',
|
cookies=cookies,
|
||||||
})
|
data={'bounds': ['-1', '1'], 'energy': '511keV'},
|
||||||
|
)
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
assert r.history
|
assert r.history
|
||||||
assert u.spawner.user_options == {
|
assert u.spawner.user_options == {
|
||||||
@@ -236,13 +237,13 @@ def test_spawn_form_admin_access(app, admin_access):
|
|||||||
base_url = ujoin(public_host(app), app.hub.base_url)
|
base_url = ujoin(public_host(app), app.hub.base_url)
|
||||||
cookies = yield app.login_user('admin')
|
cookies = yield app.login_user('admin')
|
||||||
u = add_user(app.db, app=app, name='martha')
|
u = add_user(app.db, app=app, name='martha')
|
||||||
|
next_url = ujoin(app.base_url, 'user', u.name, 'tree')
|
||||||
|
|
||||||
r = yield async_requests.post(
|
r = yield async_requests.post(
|
||||||
ujoin(base_url, 'spawn/{0}?next=/user/{0}/tree'.format(u.name)),
|
url_concat(ujoin(base_url, 'spawn', u.name), {'next': next_url}),
|
||||||
cookies=cookies, data={
|
cookies=cookies,
|
||||||
'bounds': ['-3', '3'],
|
data={'bounds': ['-3', '3'], 'energy': '938MeV'},
|
||||||
'energy': '938MeV',
|
)
|
||||||
})
|
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
assert r.history
|
assert r.history
|
||||||
assert r.url.startswith(public_url(app, u))
|
assert r.url.startswith(public_url(app, u))
|
||||||
|
Reference in New Issue
Block a user