mirror of
https://github.com/ansible/awx.git
synced 2026-03-28 14:25:05 -02:30
filter /api/v2/users/N/tokens/ to only show tokens for _that_ user
see: https://github.com/ansible/tower/issues/1773
This commit is contained in:
@@ -172,3 +172,12 @@ def test_oauth_application_delete(oauth_application, post, delete, admin):
|
||||
assert Application.objects.filter(client_id=oauth_application.client_id).count() == 0
|
||||
assert RefreshToken.objects.filter(application=oauth_application).count() == 0
|
||||
assert AccessToken.objects.filter(application=oauth_application).count() == 0
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_oauth_list_user_tokens(oauth_application, post, get, admin, alice):
|
||||
for user in (admin, alice):
|
||||
url = reverse('api:o_auth2_token_list', kwargs={'pk': user.pk})
|
||||
post(url, {'scope': 'read'}, user, expect=201)
|
||||
response = get(url, admin, expect=200)
|
||||
assert response.data['count'] == 1
|
||||
|
||||
Reference in New Issue
Block a user