def test_payload_not_a_dict():
    app = Sanic()
    Initialize(app, authenticate=authenticate, authentication_class=AnotherWrongAuthentication)
    (_, response) = app.test_client.post('/auth', json={'username': 'user1', 'password': 'abcxyz'})
    assert (response.status == 500)
    assert (response.json.get('exception') == 'InvalidPayload')
def test_payload_not_a_dict():
    app = Sanic()
    Initialize(app, authenticate=authenticate, authentication_class=AnotherWrongAuthentication)
    (_, response) = app.test_client.post('/auth', json={'username': 'user1', 'password': 'abcxyz'})
    assert (response.status == 500)
    assert (response.json.get('exception') == 'InvalidPayload')