mirror of
https://github.com/ansible/awx.git
synced 2026-05-09 02:17:37 -02:30
fix a bug that prevents unpriveleged users from listing CredentialTypes
see: #6737
This commit is contained in:
@@ -14,16 +14,20 @@ def test_list_as_unauthorized_xfail(get):
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_list_as_normal_user(get, alice):
|
||||
ssh = CredentialType.defaults['ssh']()
|
||||
ssh.save()
|
||||
response = get(reverse('api:credential_type_list'), alice)
|
||||
assert response.status_code == 200
|
||||
assert response.data['count'] == 0
|
||||
assert response.data['count'] == 1
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_list_as_admin(get, admin):
|
||||
ssh = CredentialType.defaults['ssh']()
|
||||
ssh.save()
|
||||
response = get(reverse('api:credential_type_list'), admin)
|
||||
assert response.status_code == 200
|
||||
assert response.data['count'] == 0
|
||||
assert response.data['count'] == 1
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
|
||||
Reference in New Issue
Block a user