fix a bug that prevents unpriveleged users from listing CredentialTypes

see: #6737
This commit is contained in:
Ryan Petrello
2017-06-27 16:45:46 -04:00
parent 70c11879a4
commit b0e51b42d8
2 changed files with 9 additions and 2 deletions

View File

@@ -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