From 4fc820c0cc0fb2da835b922196ac148aa459cf75 Mon Sep 17 00:00:00 2001 From: Ben Thorner Date: Thu, 29 Jul 2021 11:12:49 +0100 Subject: [PATCH] Remove redundant test about no auth proxy checks This is a lot of code to check we haven't written a single line, which we can just visually see isn't there. We should avoid having tests that check code _isn't_ there, as such testing is infinite. --- .../app/authentication/test_authentication.py | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/tests/app/authentication/test_authentication.py b/tests/app/authentication/test_authentication.py index acd86bec0..6d3a3d000 100644 --- a/tests/app/authentication/test_authentication.py +++ b/tests/app/authentication/test_authentication.py @@ -295,29 +295,6 @@ def test_should_attach_the_current_api_key_to_current_app( assert str(api_user.id) == str(sample_api_key.id) -@pytest.mark.parametrize('check_proxy_header,header_value', [ - (True, 'key_1'), - (True, 'wrong_key'), - (False, 'key_1'), - (False, 'wrong_key'), -]) -def test_requires_no_auth_proxy_key(notify_api, check_proxy_header, header_value): - with set_config_values(notify_api, { - 'ROUTE_SECRET_KEY_1': 'key_1', - 'ROUTE_SECRET_KEY_2': '', - 'CHECK_PROXY_HEADER': check_proxy_header, - }): - - with notify_api.test_client() as client: - response = client.get( - path='/_status', - headers=[ - ('X-Custom-Forwarder', header_value), - ] - ) - assert response.status_code == 200 - - @pytest.mark.parametrize('check_proxy_header,header_value,expected_status', [ (True, 'key_1', 200), (True, 'wrong_key', 403),