tests: adapt to removal of /backoffice/ page in wcs (#64973)

This commit is contained in:
Frédéric Péters 2022-05-20 13:59:40 +02:00
parent 5cdd6c0e22
commit 715832fae8
2 changed files with 10 additions and 11 deletions

View File

@ -77,6 +77,6 @@ def empty_siteoptions():
def test_with_superuser():
create_superuser()
app = login(get_app(pub))
resp = app.get('/backoffice/')
resp = app.get('/backoffice/studio/')
# this makes sure the extension loaded properly
assert '<span id="applabel">Publik</span>' in resp.text

View File

@ -91,17 +91,16 @@ def test_with_agent_submitter():
resp = app.get('/backoffice/')
# check user is automatically redirected to management/
assert resp.location == 'http://example.net/backoffice/management/'
resp = resp.maybe_follow()
assert resp.pyquery('#sidepage-menu .icon-management')
assert not resp.pyquery('#sidepage-menu .icon-submission')
formdef.backoffice_submission_roles = [role.id]
formdef.store()
resp = app.get('/backoffice/', status=200) # no redirect
# check the management and submission links are presend twice, once in the
# sidebar and once in the page body
assert resp.text.count('//example.net/backoffice/management/') == 2
assert resp.text.count('//example.net/backoffice/submission/') == 2
formdef.backoffice_submission_roles = ['blah']
formdef.store()
resp = app.get('/backoffice/')
# check user is automatically redirected to management/
resp = app.get('/backoffice/') # still redirecting to management
assert resp.location == 'http://example.net/backoffice/management/'
resp = resp.maybe_follow()
# check the management and submission links are present in side menu
assert resp.pyquery('#sidepage-menu .icon-management')
assert resp.pyquery('#sidepage-menu .icon-submission')