@@ -23,7 +23,7 @@ def client(flask_app):
2323@pytest .mark .integration
2424def test_options_request (client ):
2525 """OPTIONS request intercepted and given NO_CONTENT repsonse + CORS headers."""
26- response = client .options ("/test-endpoint" )
26+ response = client .options ("/test-endpoint" , headers = { "Origin" : "https://xyz.com" } )
2727 assert response .status_code == HTTPStatus .NO_CONTENT
2828 for header_name in CORS_HEADER_TUPLE :
2929 assert header_name in response .headers
@@ -32,7 +32,7 @@ def test_options_request(client):
3232@pytest .mark .integration
3333def test_options_request_404 (client ):
3434 """OPTIONS request returns a 404 for invalid url endpoints."""
35- response = client .options ("/bad-endpoint" )
35+ response = client .options ("/bad-endpoint" , headers = { "Origin" : "https://xyz.com" } )
3636 assert response .status_code == HTTPStatus .NOT_FOUND
3737
3838
@@ -42,7 +42,7 @@ def test_options_request_404(client):
4242@pytest .mark .integration
4343def test_requests_get (client ):
4444 """Served GET requests have proper headers."""
45- response = client .get ("/test-endpoint" )
45+ response = client .get ("/test-endpoint" , headers = { "Origin" : "https://xyz.com" } )
4646 assert response .status_code == HTTPStatus .OK
4747 for header_name in CORS_HEADER_TUPLE :
4848 assert header_name in response .headers
@@ -51,7 +51,7 @@ def test_requests_get(client):
5151@pytest .mark .integration
5252def test_requests_put (client ):
5353 """Served PUT requests have proper headers."""
54- response = client .put ("/test-endpoint" )
54+ response = client .put ("/test-endpoint" , headers = { "Origin" : "https://xyz.com" } )
5555 assert response .status_code == HTTPStatus .OK
5656 for header_name in CORS_HEADER_TUPLE :
5757 assert header_name in response .headers
@@ -60,7 +60,7 @@ def test_requests_put(client):
6060@pytest .mark .integration
6161def test_requests_post (client ):
6262 """Served POST requests have proper headers."""
63- response = client .post ("/test-endpoint" )
63+ response = client .post ("/test-endpoint" , headers = { "Origin" : "https://xyz.com" } )
6464 assert response .status_code == HTTPStatus .OK
6565 for header_name in CORS_HEADER_TUPLE :
6666 assert header_name in response .headers
@@ -69,7 +69,7 @@ def test_requests_post(client):
6969@pytest .mark .integration
7070def test_requests_patch (client ):
7171 """Served PATCH requests have proper headers."""
72- response = client .patch ("/test-endpoint" )
72+ response = client .patch ("/test-endpoint" , headers = { "Origin" : "https://xyz.com" } )
7373 assert response .status_code == HTTPStatus .OK
7474 for header_name in CORS_HEADER_TUPLE :
7575 assert header_name in response .headers
@@ -78,7 +78,7 @@ def test_requests_patch(client):
7878@pytest .mark .integration
7979def test_requests_delete (client ):
8080 """Served DELETE requests have proper headers."""
81- response = client .delete ("/test-endpoint" )
81+ response = client .delete ("/test-endpoint" , headers = { "Origin" : "https://xyz.com" } )
8282 assert response .status_code == HTTPStatus .NO_CONTENT
8383 for header_name in CORS_HEADER_TUPLE :
8484 assert header_name in response .headers
0 commit comments