예제 #1
0
def test_cors_auth(client: FlaskClient):
    response = client.options('/api/v1/auth/token', json={})
    assert response.status_code == 200 and response.headers[
        'Access-Control-Allow-Origin'] == allow_origin
    response = client.options('/api/v1/auth/register', json={})
    assert response.status_code == 200 and response.headers[
        'Access-Control-Allow-Origin'] == allow_origin
    response = client.options('/api/v1/auth/reset_password', json={})
    assert response.status_code == 200 and response.headers[
        'Access-Control-Allow-Origin'] == allow_origin
예제 #2
0
def test_cors_menu(client: FlaskClient):
    response = client.options('/api/v1/menus', json={})
    assert response.status_code == 200 and response.headers[
        'Access-Control-Allow-Origin'] == allow_origin
예제 #3
0
def test_cors_on_(client: FlaskClient):
    response = client.options('/api/v1', json={})
    assert response.status_code == 404