mirror of
https://github.com/ansible/awx.git
synced 2026-03-01 16:58:46 -03:30
Handle exception with invalid HTTP content_type.
Signed-off-by: Yunfan Zhang <yz322@duke.edu>
This commit is contained in:
@@ -107,3 +107,13 @@ def test_filterable_fields(options, instance, admin_user):
|
||||
assert filterable_info['filterable'] is True
|
||||
|
||||
assert 'filterable' not in non_filterable_info
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_handle_content_type(post, admin):
|
||||
''' Tower should return 415 when wrong content type is in HTTP requests '''
|
||||
post(reverse('api:project_list'),
|
||||
{'name': 't', 'organization': None},
|
||||
admin,
|
||||
content_type='text/html',
|
||||
expect=415)
|
||||
|
||||
Reference in New Issue
Block a user