Skip to content

Commit e2e7051

Browse files
Removes PYTHONANYWHERE_INSECURE_API as it is no longer used.
1 parent 4282e4f commit e2e7051

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

pythonanywhere_core/base.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,10 @@ def call_api(url: str, method: str, **kwargs) -> requests.Response:
5959
token = os.environ.get("API_TOKEN")
6060
if token is None:
6161
raise NoTokenError(helpful_token_error_message())
62-
insecure = os.environ.get("PYTHONANYWHERE_INSECURE_API") == "true"
6362
response = requests.request(
6463
method=method,
6564
url=url,
6665
headers={"Authorization": f"Token {token}"},
67-
verify=not insecure,
6866
**kwargs,
6967
)
7068
if response.status_code == 401:

tests/test_base.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,20 +66,6 @@ def test_raises_on_401(api_token, api_responses):
6666
assert str(e.value) == "Authentication error 401 calling API: nope"
6767

6868

69-
def test_passes_verify_from_environment(api_token, monkeypatch, mock_requests):
70-
monkeypatch.setenv("PYTHONANYWHERE_INSECURE_API", "true")
71-
72-
call_api("url", "post", foo="bar")
73-
74-
_, kwargs = mock_requests.request.call_args
75-
assert kwargs["verify"] is False
76-
77-
78-
def test_verify_is_true_if_env_not_set(api_token, mock_requests):
79-
call_api("url", "post", foo="bar")
80-
81-
_, kwargs = mock_requests.request.call_args
82-
assert kwargs["verify"] is True
8369

8470

8571
def test_raises_with_helpful_message_if_no_token_present(mocker, monkeypatch):

0 commit comments

Comments
 (0)