mirror of
https://github.com/ansible/awx.git
synced 2026-02-17 03:00:04 -03:30
hit the is_valid method before stripping the special fields in credential view
This commit is contained in:
@@ -21,6 +21,16 @@ def test_create_user_credential_via_credentials_list(post, get, alice):
|
||||
assert response.status_code == 200
|
||||
assert response.data['count'] == 1
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_credential_validation_error_with_bad_user(post, alice):
|
||||
response = post(reverse('api:credential_list'), {
|
||||
'user': 'asdf',
|
||||
'name': 'Some name',
|
||||
'username': 'someusername'
|
||||
}, alice)
|
||||
assert response.status_code == 403
|
||||
assert response.data['detail'] == 'You do not have permission to perform this action.'
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_create_user_credential_via_user_credentials_list(post, get, alice):
|
||||
response = post(reverse('api:user_credentials_list', args=(alice.pk,)), {
|
||||
|
||||
Reference in New Issue
Block a user