def METHOD_NAME(client, enabled, password):
    User.objects.create_user(username='testuser', password='correct_password')
    with override_settings(RESPA_ADMIN_USERNAME_LOGIN=enabled):
        data = {'username': 'testuser', 'password': password}
        response = client.post(login_url, data=data, HTTP_ACCEPT_LANGUAGE='en')
        content = response.content.decode('utf-8')
        if enabled and password == 'correct_password':
            assert response.status_code == 302
            assert response.url == reverse('respa_admin:index')
            assert content == ''
        elif enabled:
            assert response.status_code == 200
            assert 'Login failed' in content
        else:
            assert response.status_code == 400
            assert content == 'Username login not allowed'