mirror of
https://github.com/ansible/awx.git
synced 2026-03-02 17:28:51 -03:30
Merge pull request #1801 from AlanCoding/1773_cred_detail_serializer
Purge credential detail view of special fields
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, admin):
|
||||
response = post(reverse('api:credential_list'), {
|
||||
'user': 'asdf',
|
||||
'name': 'Some name',
|
||||
'username': 'someusername'
|
||||
}, admin)
|
||||
assert response.status_code == 400
|
||||
assert response.data['user'][0] == 'Incorrect type. Expected pk value, received unicode.'
|
||||
|
||||
@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