idp_oidc: deactivate service authz page according to setting (#45649)
This commit is contained in:
parent
4baa839294
commit
7fecf1140e
|
@ -1302,4 +1302,5 @@ class AuthorizedOauthServicesView(TemplateView):
|
|||
return HttpResponseRedirect(reverse('authorized-oauth-services'))
|
||||
|
||||
|
||||
authorized_oauth_services = AuthorizedOauthServicesView.as_view()
|
||||
authorized_oauth_services = decorators.setting_enabled(
|
||||
'A2_PROFILE_CAN_MANAGE_SERVICE_AUTHORIZATIONS')(AuthorizedOauthServicesView.as_view())
|
||||
|
|
|
@ -250,6 +250,10 @@ def test_account_view(app, simple_user, settings):
|
|||
settings.A2_PROFILE_CAN_CHANGE_EMAIL = False
|
||||
settings.A2_PROFILE_CAN_MANAGE_SERVICE_AUTHORIZATIONS = False
|
||||
settings.A2_REGISTRATION_CAN_DELETE_ACCOUNT = False
|
||||
# check that service authz page is unknown due to setting deactivation
|
||||
url = reverse('authorized-oauth-services')
|
||||
response = app.get(url, status=404)
|
||||
# only profile edit link is available on main page
|
||||
url = reverse('account_management')
|
||||
response = app.get(url, status=200)
|
||||
assert [x['href'] for x in response.html.find('div', {'id': 'a2-profile'}).find_all('a')] == [
|
||||
|
|
Loading…
Reference in New Issue