0001-manager-remind-OU-in-user-roles-breadcrumb-47408.patch
src/authentic2/manager/templates/authentic2/manager/user_ou_roles.html | ||
---|---|---|
1 | 1 |
{% extends "authentic2/manager/base.html" %} |
2 | 2 |
{% load i18n staticfiles django_tables2 %} |
3 | 3 | |
4 | 4 |
{% block breadcrumb %} |
5 | 5 |
{{ block.super }} |
6 | 6 |
<a href="{% url 'a2-manager-users' %}">{% trans 'Users' %}</a> |
7 |
<a href="../?search-ou={{ object.ou.pk }}">{{ object.ou }}</a> |
|
7 | 8 |
<a href="{% url 'a2-manager-user-detail' pk=object.pk %}">{{ object.get_full_name }}</a> |
8 | 9 |
<a href="#">{% trans "Roles" %}</a> |
9 | 10 |
{% endblock %} |
10 | 11 | |
11 | 12 |
{% block page_title %} |
12 | 13 |
{% trans "Edit User Roles" %} |
13 | 14 |
{% endblock %} |
14 | 15 |
tests/test_user_manager.py | ||
---|---|---|
915 | 915 |
# cannot click it's JS :/ |
916 | 916 |
token = str(resp.context['csrf_token']) |
917 | 917 |
params = {'authorization': auth.pk, 'csrfmiddlewaretoken': token} |
918 | 918 |
resp = app.post(user_authorizations_url, params=params, status=302) |
919 | 919 |
assert OIDCAuthorization.objects.count() == 0 |
920 | 920 |
resp = resp.follow() |
921 | 921 |
assert resp.html.find('td').text == \ |
922 | 922 |
'This user has not granted profile data access to any service yet.' |
923 | ||
924 | ||
925 |
def test_manager_user_roles_breadcrumb(app, superuser, simple_user): |
|
926 |
resp = login(app, superuser) |
|
927 |
user_roles_url = reverse( |
|
928 |
'a2-manager-user-roles', kwargs={'pk': simple_user.id}) |
|
929 |
resp = app.get(user_roles_url, status=200) |
|
930 |
assert [x.text for x in resp.html.find('span', {'id': 'breadcrumb'}).find_all('a')] == [ |
|
931 |
'Homepage', 'Administration', 'Users', 'Default organizational unit', |
|
932 |
'Jôhn Dôe', 'Roles'] |
|
933 |
user_roles_url = reverse( |
|
934 |
'a2-manager-user-roles', kwargs={'pk': superuser.id}) |
|
935 |
resp = app.get(user_roles_url, status=200) |
|
936 |
assert [x.text for x in resp.html.find('span', {'id': 'breadcrumb'}).find_all('a')] == [ |
|
937 |
'Homepage', 'Administration', 'Users', |
|
938 |
'super user', 'Roles'] |
|
923 |
- |