Exemplo n.º 1
0
def test_cors_enabled_function_preflight(app):
    with app.test_request_context(method='OPTIONS'):
        res = main.cors_enabled_function(flask.request)
        assert res[2].get('Access-Control-Allow-Origin') == '*'
        assert res[2].get('Access-Control-Allow-Methods') == 'GET'
        assert res[2].get('Access-Control-Allow-Headers') == 'Content-Type'
        assert res[2].get('Access-Control-Max-Age') == '3600'
def test_cors_enabled_function_preflight(app):
    with app.test_request_context(method='OPTIONS'):
        res = main.cors_enabled_function(flask.request)
        assert res[2].get('Access-Control-Allow-Origin') == '*'
        assert res[2].get('Access-Control-Allow-Methods') == 'GET'
        assert res[2].get('Access-Control-Allow-Headers') == 'Content-Type'
        assert res[2].get('Access-Control-Max-Age') == '3600'
Exemplo n.º 3
0
def test_cors_enabled_function_main(app):
    with app.test_request_context(method='GET'):
        res = main.cors_enabled_function(flask.request)
        assert res[2].get('Access-Control-Allow-Origin') == '*'
def test_cors_enabled_function_main(app):
    with app.test_request_context(method='GET'):
        res = main.cors_enabled_function(flask.request)
        assert res[2].get('Access-Control-Allow-Origin') == '*'