don't allow Accept:application/json on /api/login/

see: https://github.com/ansible/tower/issues/1672
This commit is contained in:
Ryan Petrello
2018-05-25 14:13:04 -04:00
parent b5cb4e8290
commit a0433773d8
2 changed files with 36 additions and 2 deletions

View File

@@ -24,6 +24,20 @@ class AlwaysPassBackend(object):
return '{}.{}'.format(cls.__module__, cls.__name__)
@pytest.mark.django_db
@pytest.mark.parametrize('accept, status', [
['*/*', 200],
['text/html', 200],
['application/json', 406]
])
def test_login_json_not_allowed(get, accept, status):
get(
'/api/login/',
HTTP_ACCEPT=accept,
expect=status
)
@pytest.mark.skip(reason="Needs Update - CA")
@pytest.mark.django_db
def test_session_create_delete(admin, post, get):