mirror of
https://github.com/ansible/awx.git
synced 2026-02-18 19:50:05 -03:30
@@ -619,6 +619,22 @@ def test_list_cannot_order_by_encrypted_field(post, get, organization, org_admin
|
||||
assert response.status_code == 400
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_v1_credential_kind_validity(get, post, organization, admin, credentialtype_ssh):
|
||||
params = {
|
||||
'name': 'Best credential ever',
|
||||
'organization': organization.id,
|
||||
'kind': 'nonsense'
|
||||
}
|
||||
response = post(
|
||||
reverse('api:credential_list', kwargs={'version': 'v1'}),
|
||||
params,
|
||||
admin
|
||||
)
|
||||
assert response.status_code == 400
|
||||
assert response.data['kind'] == ['"nonsense" is not a valid choice']
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_inputs_cannot_contain_extra_fields(get, post, organization, admin, credentialtype_ssh):
|
||||
params = {
|
||||
|
||||
Reference in New Issue
Block a user