diff --git a/app/main/views/index.py b/app/main/views/index.py index a36fdd133..7e59a0347 100644 --- a/app/main/views/index.py +++ b/app/main/views/index.py @@ -36,17 +36,6 @@ def index(): ) -@main.route('/robots.txt') -def robots(): - return ( - 'User-agent: *\n' - 'Disallow: /sign-in\n' - 'Disallow: /support\n' - 'Disallow: /support/\n' - 'Disallow: /register\n' - ), 200, {'Content-Type': 'text/plain'} - - @main.route('/error/') def error(status_code): if status_code >= 500: diff --git a/app/navigation.py b/app/navigation.py index b407db0a5..d98fba4cb 100644 --- a/app/navigation.py +++ b/app/navigation.py @@ -256,7 +256,6 @@ class HeaderNavigation(Navigation): 'returned_letters', 'returned_letters_report', 'revoke_api_key', - 'robots', 'send_messages', 'send_notification', 'send_one_off', @@ -608,7 +607,6 @@ class MainNavigation(Navigation): 'returned_letters_report', 'revalidate_email_sent', 'roadmap', - 'robots', 'security', 'send_notification', 'send_from_contact_list', @@ -870,7 +868,6 @@ class CaseworkNavigation(Navigation): 'revalidate_email_sent', 'revoke_api_key', 'roadmap', - 'robots', 'security', 'send_messages', 'send_notification', @@ -1163,7 +1160,6 @@ class OrgNavigation(Navigation): 'revalidate_email_sent', 'revoke_api_key', 'roadmap', - 'robots', 'security', 'send_messages', 'send_notification', diff --git a/tests/app/main/views/test_index.py b/tests/app/main/views/test_index.py index 7dc94201a..9242b9c88 100644 --- a/tests/app/main/views/test_index.py +++ b/tests/app/main/views/test_index.py @@ -63,18 +63,8 @@ def test_logged_in_user_redirects_to_choose_account( ) -def test_robots(client): - assert url_for('main.robots') == '/robots.txt' - response = client.get(url_for('main.robots')) - assert response.headers['Content-Type'] == 'text/plain' - assert response.status_code == 200 - assert response.get_data(as_text=True) == ( - 'User-agent: *\n' - 'Disallow: /sign-in\n' - 'Disallow: /support\n' - 'Disallow: /support/\n' - 'Disallow: /register\n' - ) +def test_robots(client_request): + client_request.get_url('/robots.txt', _expected_status=404) @pytest.mark.parametrize('endpoint, kwargs', (