fix a 500 error in /api/v1/credentials/ backwards compat

see: #6414
This commit is contained in:
Ryan Petrello
2017-06-01 11:22:27 -04:00
parent e7d1e2d3a4
commit fd4b86349c
2 changed files with 18 additions and 0 deletions

View File

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